Skip to content
Snippets Groups Projects
Commit f632c04d authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Implement TotalPackaging, MinPackaging and MaxPackaging variables

parent a5e3c27a
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,6 @@ defined('_JEXEC') or die();
*/
// print "<h3>vmlengthunit.php LOADING</h3>";
if (!class_exists('VmConfig'))
require(JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php');
......
......@@ -261,7 +261,8 @@ class ShippingRule_Advanced extends ShippingRule {
}
$o2 = array_pop($stack); // 4a)
$o1 = array_pop($stack);
// Special-case chained comparisons: if e is a comparison, and operator(o1) is also a comparison,
// Special-case chained comparisons, e.g. 1<=Amount<100:
// if e is a comparison, and operator(o1) is also a comparison,
// insert the arguments to the existing comparison instead of creating a new one
if (in_array ($e, $comparison_ops)) {
if ($o1[0]=='comparison') {
......
......@@ -363,6 +363,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
'maxlength' => 0, 'minlength' => 9999999999, 'totallength' => 0,
'maxwidth' => 0, 'minwidth' => 9999999999, 'totalwidth' => 0,
'maxheight' => 0, 'minheight' => 9999999999, 'totalheight' => 0,
'maxpackaging' => 0, 'minpackaging' => 9999999999, 'totalpackaging' => 0,
);
if ($calculated==0) {
$calculated=1;
......@@ -376,15 +377,19 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
$dimensions['volume'] += $volume * $product->quantity;
$dimensions['maxvolume'] = max ($dimensions['maxvolume'], $volume);
$dimensions['minvolume'] = min ($dimensions['minvolume'], $volume);
$dimensions['totallength'] += $l * $product->quantity;
$dimensions['maxlength'] = max ($dimensions['maxlength'], $l);
$dimensions['minlength'] = min ($dimensions['minlength'], $l);
$dimensions['totalwidth'] += $w * $product->quantity;
$dimensions['maxwidth'] = max ($dimensions['maxwidth'], $w);
$dimensions['minwidth'] = min ($dimensions['minwidth'], $w);
$dimensions['totalheight'] += $h * $product->quantity;
$dimensions['maxheight'] = max ($dimensions['maxheight'], $h);
$dimensions['minheight'] = min ($dimensions['minheight'], $h);
$dimensions['totallength'] += $l * $product->quantity;
$dimensions['totalwidth'] += $w * $product->quantity;
$dimensions['totalheight'] += $h * $product->quantity;
$dimensions['totalpackaging'] += $product->packaging * $product->quantity;
$dimensions['maxpackaging'] = max ($dimensions['maxpackaging'], $product->packaging);
$dimensions['minpackaging'] = min ($dimensions['minpackaging'], $product->packaging);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment