[-] FO : potential divide by zero removed #PSCFV-2787
This commit is contained in:
@@ -799,8 +799,12 @@ class CartRuleCore extends ObjectModel
|
|||||||
if ($this->reduction_amount)
|
if ($this->reduction_amount)
|
||||||
{
|
{
|
||||||
$prorata = 1;
|
$prorata = 1;
|
||||||
if (!is_null($package))
|
if (!is_null($package) && count($all_products))
|
||||||
$prorata = $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS, $package['products']) / $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS);
|
{
|
||||||
|
$total_products = $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS);
|
||||||
|
if ($total_products)
|
||||||
|
$prorata = $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS, $package['products']) / $total_products;
|
||||||
|
}
|
||||||
|
|
||||||
$reduction_amount = $this->reduction_amount;
|
$reduction_amount = $this->reduction_amount;
|
||||||
// If we need to convert the voucher value to the cart currency
|
// If we need to convert the voucher value to the cart currency
|
||||||
|
|||||||
Reference in New Issue
Block a user