From b04e464aaff0da0d0171180189fbde630ba86db9 Mon Sep 17 00:00:00 2001 From: merdan Date: Mon, 29 Aug 2022 20:21:36 +0500 Subject: [PATCH] wellknow --- .../API/Http/Resources/Catalog/Product.php | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index bfcc70dfd..898d5161c 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -40,38 +40,38 @@ class Product extends JsonResource 'type' => $product->type, 'name' => $product->name, // 'url_key' => $product->url_key, - 'price' => $this->price,//(double) core()->convertPrice($productTypeInstance->getMinimalPrice()), - 'min_price' => $this->min_price, -// 'formatted_price' => core()->currency($productTypeInstance->getMinimalPrice()), -//// 'short_description' => $product->short_description, -// 'description' => $product->description, -// 'images' => ProductImage::collection($product->images), -// /* product's checks */ -//// 'in_stock' => $product->haveSufficientQuantity(1), -// 'is_wishlisted' => $this->isWishlisted($product) , -// 'is_item_in_cart' => \Cart::hasProduct($product), -// 'shop_title' => $this->shop_title, -//// 'new' => $this->new, -//// 'featured' => $this->featured, -// 'brand' => $product->brand->name ?? '', -//// 'show_quantity_changer' => $this->when( -//// $product->type !== 'grouped', -//// $product->getTypeInstance()->showQuantityBox() -//// ), -// /* -// * attributes -// */ -//// 'specifications' => app('Webkul\Product\Helpers\View')->getAdditionalData($product), -// /* product's extra information */ -// $this->merge($this->allProductExtraInfo()), -// -// /* special price cases */ -// $this->merge($this->specialPriceInfo()), -// -// /* super attributes */ -// $this->mergeWhen($this->super_attributes, [ -// 'super_attributes' => $this->super_attributes, -// ]), + 'price' => (double) core()->convertPrice($productTypeInstance->getMinimalPrice()), + + 'formatted_price' => core()->currency($productTypeInstance->getMinimalPrice()), +// 'short_description' => $product->short_description, + 'description' => $product->description, + 'images' => ProductImage::collection($product->images), + /* product's checks */ +// 'in_stock' => $product->haveSufficientQuantity(1), + 'is_wishlisted' => $this->isWishlisted($product) , + 'is_item_in_cart' => \Cart::hasProduct($product), + 'shop_title' => $this->shop_title, +// 'new' => $this->new, +// 'featured' => $this->featured, + 'brand' => $product->brand->name ?? '', +// 'show_quantity_changer' => $this->when( +// $product->type !== 'grouped', +// $product->getTypeInstance()->showQuantityBox() +// ), + /* + * attributes + */ +// 'specifications' => app('Webkul\Product\Helpers\View')->getAdditionalData($product), + /* product's extra information */ + $this->merge($this->allProductExtraInfo()), + + /* special price cases */ + $this->merge($this->specialPriceInfo()), + + /* super attributes */ + $this->mergeWhen($this->super_attributes, [ + 'super_attributes' => $this->super_attributes, + ]), ]; } private function super_attributes(){