// bug fix for the cart rules
This commit is contained in:
@@ -258,9 +258,23 @@ class AdminCartRulesControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$productRulesArray = array();
|
$productRulesArray = array();
|
||||||
$productRules = $cartRule->getProductRules();
|
if (Tools::getValue('product_restriction') && is_array($array = Tools::getValue('product_rule')) && count($array))
|
||||||
foreach ($productRules as $productRule)
|
{
|
||||||
$productRulesArray[] = $this->getProductRuleDisplay($i++, $productRule['type'], $productRule['quantity'], $productRule['values']);
|
foreach ($array as $id)
|
||||||
|
{
|
||||||
|
$productRulesArray[] = $this->getProductRuleDisplay(
|
||||||
|
$i++,
|
||||||
|
Tools::getValue('product_rule_'.$id.'_type'),
|
||||||
|
(int)Tools::getValue('product_rule_'.$id.'_quantity'),
|
||||||
|
Tools::getValue('product_rule_select_'.$id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach ($cartRule->getProductRules() as $productRule)
|
||||||
|
$productRulesArray[] = $this->getProductRuleDisplay($i++, $productRule['type'], $productRule['quantity'], $productRule['values']);
|
||||||
|
}
|
||||||
return $productRulesArray;
|
return $productRulesArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user