diff --git a/library/rules_shipping_framework.php b/library/rules_shipping_framework.php index ce7118b4205416d847447d7b17cf3f7c84074d2d..5fc8fae91fa6872afd8fd2c0b2cab3788d29dc06 100644 --- a/library/rules_shipping_framework.php +++ b/library/rules_shipping_framework.php @@ -673,8 +673,8 @@ class ShippingRule { $filterkeys = array( "evaluate_for_categories" => 'categories', - "evaluate_for_products" => 'products', - "evaluate_for_skus" => 'products', + "evaluate_for_products" => 'skus', + "evaluate_for_skus" => 'skus', "evaluate_for_vendors" => 'vendors', "evaluate_for_manufacturers" => 'manufacturers' ); @@ -790,7 +790,7 @@ class ShippingRule { // The scoping functions need to be handled differently, because they first need to adjust the cart variables to the filtered product list // before evaluating its first argument. So even though parsing the rules handles scoping functions like any other function, their // evaluation is fundamentally different and is special-cased here: - $scoping_functions = array("evaluate_for_categories", "evaluate_for_products", "evaluate_for_vendors", "evaluate_for_manufacturers"); + $scoping_functions = array("evaluate_for_categories", "evaluate_for_products", "evaluate_for_skus", "evaluate_for_vendors", "evaluate_for_manufacturers"); $is_scoping = is_array($expr) && ($expr[0]=="FUNCTION") && (count($expr)>1) && in_array($expr[1], $scoping_functions); if (is_null($expr)) { @@ -808,7 +808,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)) {