diff --git a/packages/Sarga/API/Http/Controllers/Products.php b/packages/Sarga/API/Http/Controllers/Products.php index 9fb8f5b49..bbd4fc6ff 100644 --- a/packages/Sarga/API/Http/Controllers/Products.php +++ b/packages/Sarga/API/Http/Controllers/Products.php @@ -60,8 +60,15 @@ class Products extends ProductController public function product($id){ $product = $this->productRepository->select('id','attribute_family_id','type','brand_id') - ->with(['brand','related_products'=> fn($rp) => $rp->select('id','type','attribute_family_id','brand_id')->with('brand'), + ->with(['brand','related_products'=> fn($rp) => $rp->select('id','type','attribute_family_id','brand_id') + ->with('brand') + ->whereHas('product_flat', function($qwh){ + $qwh->where('status',1); + }), 'variants' => function($query){ + $query->whereHas('product_flat', function($qwh){ + $qwh->where('status',1); + }); $query->with(['product_flats' => function($qf){ $channel = core()->getRequestedChannelCode();