diff --git a/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php b/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php index b5546536d..676c9a9ee 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php +++ b/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php @@ -25,8 +25,8 @@ class ProductDetail extends Product 'brand' => $product->brand->name ?? '', 'color' => $product->color, 'images' => ProductImage::collection($product->images), - 'color_variants' => ColorVariant::collection($product->related_products->where('status',1)), - 'size_variants' => SizeVariant::collection($product->variants->where('status',1)), + 'color_variants' => ColorVariant::collection($this->related_products), + 'size_variants' => SizeVariant::collection($this->variants), /* special price cases */ $this->merge($this->specialPriceInfo()), diff --git a/packages/Sarga/API/Http/Resources/Catalog/SizeVariant.php b/packages/Sarga/API/Http/Resources/Catalog/SizeVariant.php index 2e00e1706..41bc165ea 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/SizeVariant.php +++ b/packages/Sarga/API/Http/Resources/Catalog/SizeVariant.php @@ -21,7 +21,7 @@ class SizeVariant extends ProductDetail 'name' => $product->name, 'size' => $flat->size ?? 0, 'size_label' => $flat->size_label ?? null, - + 'status' => $flat->status, /* special price cases */ $this->merge($this->specialPriceInfo()),