// 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 1fdc93166e
commit 01a39d9996
+7 -8
View File
@@ -655,14 +655,13 @@ class CartRuleCore extends ObjectModel
{ {
$selectedProductsReduction = 0; $selectedProductsReduction = 0;
$selectedProducts = $this->checkProductRestrictions($context, true); $selectedProducts = $this->checkProductRestrictions($context, true);
foreach ($context->cart->getProducts() as $product) if (is_array($selectedProducts))
{ foreach ($context->cart->getProducts() as $product)
if (in_array($product['id_product'], $selectedProducts)) if (in_array($product['id_product'], $selectedProducts))
{ {
$price = ($useTax ? $product['price_wt'] : $product['price']); $price = ($useTax ? $product['price_wt'] : $product['price']);
$selectedProductsReduction += $price * $product['cart_quantity']; $selectedProductsReduction += $price * $product['cart_quantity'];
} }
}
$reductionValue += $selectedProductsReduction * $this->reduction_percent / 100; $reductionValue += $selectedProductsReduction * $this->reduction_percent / 100;
} }