diff --git a/elements/vmlengthunit.php b/elements/vmlengthunit.php index 1aea5bb9f03f4e52abe0650052ab480fc7d6fb59..64c9d44f28020bd02061441bfea306a7154608fb 100644 --- a/elements/vmlengthunit.php +++ b/elements/vmlengthunit.php @@ -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'); diff --git a/rules_shipping_advanced.php b/rules_shipping_advanced.php index a3da1649a3f989b4f5bc04d64177e39a14ba9b24..30ff7314eca24fb3b927c5dd88b32885921a8dea 100644 --- a/rules_shipping_advanced.php +++ b/rules_shipping_advanced.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') { diff --git a/rules_shipping_base.php b/rules_shipping_base.php index d8a264d9c1d410c5b1c62369d1192d3d885e508f..ab55f094c6aaad5ffc698449caa18f62374af68a 100644 --- a/rules_shipping_base.php +++ b/rules_shipping_base.php @@ -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); } }