diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index 24af419ac..6e6d83a0d 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -83,7 +83,13 @@ class Product extends JsonResource */ private function specialPriceInfo() { - $product = $this->type == 'configurable' ? $this->product->getTypeInstance()->getMinPriceVariant()->product : $this->product; + if($this->type == 'configurable') + { + $variant = $this->variants()->with('product')->orderBy('min_price')->first(); + $product = $variant->product; + }else{ + $product = $this->product ? $this->product : $this; + } $typeInstance = $product->getTypeInstance();