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

Version 2.4.4: Fix weight unit conversion...

parent e5cdc6d5
No related branches found
No related tags found
No related merge requests found
BASE=rules_shipping
BASE_ADV=rules_shipping_advanced
PLUGINTYPE=vmshipment
VERSION=2.4.3
VERSION=2.4.4
PLUGINFILES=$(BASE).php $(BASE)_base.php $(BASE).script.php $(BASE).xml index.html
PLUGINFILES_ADV=$(BASE_ADV).php $(BASE)_base.php $(BASE_ADV).script.php $(BASE_ADV).xml index.html
......
File added
File added
......@@ -6,7 +6,7 @@
<authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
<license>GPL v3+</license>
<version>2.4.2</version>
<version>2.4.4</version>
<description>VMSHIPMENT_RULES_DESC</description>
<files>
<filename plugin="rules_shipping">rules_shipping.php</filename>
......
......@@ -6,7 +6,7 @@
<authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
<license>GPL v3+</license>
<version>2.4.3</version>
<version>2.4.4</version>
<description>VMSHIPMENT_RULES_ADV_DESC</description>
<files>
<filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename>
......
......@@ -390,7 +390,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
return $dimensions;
}
function getOrderWeights (VirtueMartCart $cart, $weight_units) {
function getOrderWeights (VirtueMartCart $cart, $weight_unit) {
static $calculated = 0;
static $dimensions=array(
'weight' => 0,
......@@ -399,7 +399,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
if ($calculated==0 && count($cart->products)>0) {
$calculated = 1;
foreach ($cart->products as $product) {
$w = ShopFunctions::convertWeigthUnit ($product->product_weight, $product->product_weight_uom, $to_weight_unit);
$w = ShopFunctions::convertWeigthUnit ($product->product_weight, $product->product_weight_uom, $weight_unit);
$dimensions['maxweight'] = max ($dimensions['maxweight'], $w);
$dimensions['minweight'] = min ($dimensions['minweight'], $w);
$dimensions['weight'] += $w * $product->quantity;
......@@ -445,6 +445,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
$cartvals = array_merge ($cartvals, $this->getOrderDimensions ($cart, $method->length_unit));
// Let child classes update the $cartvals array, or add new variables
$this->addCustomCartValues($cart, $cart_prices, $cartvals);
// JFactory::getApplication()->enqueueMessage("<pre>cart prices: ".print_r($cart_prices,1)."</pre>", 'error');
return $cartvals;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment