// 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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user