From b861435554bc79d6f29a618c876d8f11bfccd345 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 14 Nov 2019 17:15:55 +0530 Subject: [PATCH] Fixed issues related to discount calculations --- .../Webkul/Discount/src/Helpers/Cart/Discount.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/Webkul/Discount/src/Helpers/Cart/Discount.php b/packages/Webkul/Discount/src/Helpers/Cart/Discount.php index a3f048951..415a6b657 100644 --- a/packages/Webkul/Discount/src/Helpers/Cart/Discount.php +++ b/packages/Webkul/Discount/src/Helpers/Cart/Discount.php @@ -433,12 +433,15 @@ abstract class Discount foreach ($productIDs as $productID) { foreach ($cart->items as $item) { - $childrens = $item->children; + if ($item->product_id == $productID) + $partialMatch = 1; + } - foreach ($childrens as $children) { - if ($children->product_id == $productID) - $partialMatch = 1; - } + $childrens = $item->children; + + foreach ($childrens as $children) { + if ($children->product_id == $productID) + $partialMatch = 1; } } }