menu Controller

This commit is contained in:
merdan 2022-09-22 13:44:53 +05:00
parent a176efe6e5
commit c9126ec5cd
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}