From 4e10d706f506a9fbc007efcf5fed2a5b7ce3a7fc Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Fri, 13 Mar 2020 19:03:19 +0530 Subject: [PATCH] Catalog price rule issue fixed if discounted and normal price is same --- .../CatalogRule/src/Helpers/CatalogRuleProductPrice.php | 4 ++-- packages/Webkul/Product/src/Type/AbstractType.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php index a870a2273..2d7413526 100644 --- a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php @@ -98,8 +98,8 @@ class CatalogRuleProductPrice foreach ($dates as $key => $date) { if ((! $row->starts_from || $date >= $row->starts_from) - && (! $row->ends_till || $date <= $row->ends_till)) - { + && (! $row->ends_till || $date <= $row->ends_till) + ) { $priceKey = $date->getTimestamp() . '-' . $productKey; if (isset($endRuleFlags[$priceKey])) { diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index a0dfcf813..3bc887ce2 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -495,7 +495,7 @@ abstract class AbstractType } if (! (float) $this->product->special_price) { - if ($rulePrice) { + if ($rulePrice && $rulePrice->price < $this->product->price) { $this->product->special_price = $rulePrice->price; return true;