Commit e200a1a3 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V5.5: Fix evaluate_for_skus function

parent 44a43124
......@@ -2,7 +2,7 @@ BASE=rules_shipping
BASE_ADV=rules_shipping_advanced
PLUGINTYPE=vmshipment
ZIPBASE=opentools_vm
VERSION=5.4
VERSION=5.5
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
......
......@@ -6,7 +6,7 @@
<authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013-2014, Reinhold Kainhofer</copyright>
<license>GPL v3+</license>
<version>5.4</version>
<version>5.5</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-2014, Reinhold Kainhofer</copyright>
<license>GPL v3+</license>
<version>5.4</version>
<version>5.5</version>
<description>VMSHIPMENT_RULES_ADV_DESC</description>
<files>
<filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename>
......
......@@ -469,7 +469,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
}
} else {
// BEGIN_RK_CHANGES: VM change in VM3!
if (is_array($calculator->_cartData)) { // VM2:
if (isset($calculator->_cartData) && is_array($calculator->_cartData)) { // VM2:
$taxrules = array_merge($calculator->_cartData['VatTax'],$calculator->_cartData['taxRulesBill']);
} else { // VM3:
$taxrules = array_merge($cart->cartData['VatTax'],$cart->cartData['taxRulesBill']);
......@@ -1204,9 +1204,10 @@ class ShippingRule {
$filterkeys = array(
"evaluate_for_categories" => 'categories',
"evaluate_for_products" => 'products',
"evaluate_for_products" => 'skus',
"evaluate_for_skus" => 'skus',
"evaluate_for_vendors" => 'vendors',
"evaluate_for_manufacturers" => 'manufacturers'
"evaluate_for_manufacturers" => 'manufacturers',
);
$conditions = array();
......@@ -1338,7 +1339,11 @@ class ShippingRule {
$op = array_shift($expr); // ignore the "FUNCTION"
$func = array_shift($expr); // The scoping function name
$expression = array_shift($expr); // The expression to be evaluated
$conditions = $expr; // the remaining $expr list now contains the conditions
// the remaining $expr list now contains the conditions. Evaluate them one by one:
$conditions = array();
foreach ($expr as $e) {
$conditions[] = $this->evaluateTerm($e, $vals, $products, $cartvals_callback);
}
return $this->evaluateScoping ($expression, $func, $conditions, $vals, $products, $cartvals_callback);
} elseif (is_array($expr)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment