Commit 2eefc774 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Some more refactoring to the library

parent 9e3dcb4f
......@@ -263,6 +263,10 @@ class RulesShippingFramework {
return $cartvals;
}
protected function getCartProducts($cart, $method) {
return array();
}
/** This function evaluates all rules, one after the other until it finds a matching rule that
* defines shipping costs (or uses NoShipping). If a modifier or definition is encountered,
......@@ -274,7 +278,7 @@ class RulesShippingFramework {
return $this->match[$id];
} else {
// Evaluate all rules and find the matching ones (including modifiers and definitions!)
$cartvals = $this->getCartValues ($cart, $cart->products, $method);
$cartvals = $this->getCartValues ($cart, $this->getCartProducts($cart, $method), $method);
$result = array(
"rule" => Null,
"rule_name" => "",
......@@ -670,6 +674,7 @@ class ShippingRule {
$filterkeys = array(
"evaluate_for_categories" => 'categories',
"evaluate_for_products" => 'products',
"evaluate_for_skus" => 'products',
"evaluate_for_vendors" => 'vendors',
"evaluate_for_manufacturers" => 'manufacturers'
);
......
......@@ -68,6 +68,10 @@ class RulesShippingFrameworkJoomla extends RulesShippingFramework {
$method->includes_tax = $r->includes_tax;
}
protected function getCartProducts($cart, $method) {
return $cart->products;
}
protected function getMethodId($method) {
return $method->virtuemart_shipmentmethod_id;
}
......
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