From 7fe5e1801c588007bd51505376e7b43d8b3a3ead Mon Sep 17 00:00:00 2001 From: merdan Date: Tue, 11 Apr 2023 13:25:20 +0500 Subject: [PATCH] product detail --- packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php | 4 ++-- packages/Sarga/API/Http/Resources/Catalog/SizeVariant.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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()),