// Fixed small bug which occured when you refreshed a reduction on a selection of product on an order that did not match the selection anymore

This commit is contained in:
dMetzger
2012-02-06 16:29:47 +00:00
parent 1808add4d8
commit ce43fd035b
+7 -8
View File
@@ -655,14 +655,13 @@ class CartRuleCore extends ObjectModel
{
$selectedProductsReduction = 0;
$selectedProducts = $this->checkProductRestrictions($context, true);
foreach ($context->cart->getProducts() as $product)
{
if (in_array($product['id_product'], $selectedProducts))
{
$price = ($useTax ? $product['price_wt'] : $product['price']);
$selectedProductsReduction += $price * $product['cart_quantity'];
}
}
if (is_array($selectedProducts))
foreach ($context->cart->getProducts() as $product)
if (in_array($product['id_product'], $selectedProducts))
{
$price = ($useTax ? $product['price_wt'] : $product['price']);
$selectedProductsReduction += $price * $product['cart_quantity'];
}
$reductionValue += $selectedProductsReduction * $this->reduction_percent / 100;
}