From f4cc2b3c1fa581684146c4985b8644d672a0a9ea Mon Sep 17 00:00:00 2001 From: merdan Date: Fri, 3 Jun 2022 12:32:01 +0500 Subject: [PATCH] management integration start --- packages/Sarga/API/Http/Resources/Catalog/Product.php | 8 ++++---- .../Sarga/API/Http/Resources/Catalog/ProductVariant.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index 486fcc958..f077bb180 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -106,17 +106,17 @@ class Product extends JsonResource $productTypeInstance = $product->getTypeInstance(); return [ - 'special_price' => (double) $this->when( + 'special_price' => $this->when( $productTypeInstance->haveSpecialPrice(), - core()->convertPrice($productTypeInstance->getSpecialPrice()) + (double) core()->convertPrice($productTypeInstance->getSpecialPrice()) ), 'formatted_special_price' => $this->when( $productTypeInstance->haveSpecialPrice(), core()->currency($productTypeInstance->getSpecialPrice()) ), - 'regular_price' => (double) $this->when( + 'regular_price' => $this->when( $productTypeInstance->haveSpecialPrice(), - data_get($productTypeInstance->getProductPrices(), 'regular_price.price') + (double) data_get($productTypeInstance->getProductPrices(), 'regular_price.price') ), 'formatted_regular_price' => $this->when( $productTypeInstance->haveSpecialPrice(), diff --git a/packages/Sarga/API/Http/Resources/Catalog/ProductVariant.php b/packages/Sarga/API/Http/Resources/Catalog/ProductVariant.php index 22c664e7f..b46403d91 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/ProductVariant.php +++ b/packages/Sarga/API/Http/Resources/Catalog/ProductVariant.php @@ -98,17 +98,17 @@ class ProductVariant extends JsonResource $productTypeInstance = $product->getTypeInstance(); return [ - 'special_price' => (double) $this->when( + 'special_price' => $this->when( $productTypeInstance->haveSpecialPrice(), - core()->convertPrice($productTypeInstance->getSpecialPrice()) + (double) core()->convertPrice($productTypeInstance->getSpecialPrice()) ), 'formatted_special_price' => $this->when( $productTypeInstance->haveSpecialPrice(), core()->currency($productTypeInstance->getSpecialPrice()) ), - 'regular_price' => (double) $this->when( + 'regular_price' => $this->when( $productTypeInstance->haveSpecialPrice(), - data_get($productTypeInstance->getProductPrices(), 'regular_price.price') + (double) data_get($productTypeInstance->getProductPrices(), 'regular_price.price') ), 'formatted_regular_price' => $this->when( $productTypeInstance->haveSpecialPrice(),