From 0ca221f2de90d264006138a8d25bf54e5ee25eb9 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 21 Apr 2022 14:03:19 +0500 Subject: [PATCH] discounted configurables --- .../Webkul/Product/src/Type/AbstractType.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index 066d214a6..e8dbdbc89 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -524,18 +524,7 @@ abstract class AbstractType */ public function getSpecialPrice($qty = null) { - if($this->haveSpecialPrice($qty)){ - if($this->product->type == 'configurable' && - $variant = $this->product->variants() - ->whereNotNull('special_price') - ->orderBy('special_price','asc') - ->first()) - { - return $variant->special_price; - } - return $this->product->special_price; - } - return $this->product->price; + return $this->haveSpecialPrice($qty) ? $this->product->special_price : $this->product->price; } /** @@ -556,8 +545,7 @@ abstract class AbstractType && ! $rulePrice && $customerGroupPrice == $this->product->price ) { - - return $this->product->type == 'configurable' && $this->product->variants()->whereNotNull('special_price')->count(); + return false; } $haveSpecialPrice = false;