From 3a8ecf68036fb08f1afe18ef9672a2a9bab58745 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 21 Apr 2022 16:54:29 +0500 Subject: [PATCH] discounted configurables --- packages/Sarga/API/Http/Resources/Catalog/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index 5b2d165a2..9b7e10ea9 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -215,7 +215,7 @@ class Product extends JsonResource 'color_count' => $this->variants->groupBy('color')->count(), ]; - if( $special_variant = $this->variants->whereNotNull('special_price')->orderBy('special_price')->first()){ + if( $special_variant = $this->variants->whereNotNull('special_price')->sortBy('special_price')->first()){ $data = array_merge($data, [ 'special_price' => $special_variant->special_price, 'formatted_special_price' => core()->currency($special_variant->special_price),