diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index 6e6d83a0d..990d2c438 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -85,8 +85,8 @@ class Product extends JsonResource { if($this->type == 'configurable') { - $variant = $this->variants()->with('product')->orderBy('min_price')->first(); - $product = $variant->product; + $product = $this->variants()->with('product_flat')->orderBy('product_flat.min_price')->first(); + }else{ $product = $this->product ? $this->product : $this; }