menu Controller

This commit is contained in:
merdan 2022-09-22 13:20:35 +05:00
parent 8b88036727
commit 47a7c80a32
1 changed files with 9 additions and 9 deletions

View File

@ -88,19 +88,19 @@ class Product extends JsonResource
$typeInstance = $product->getTypeInstance();
return [
'images' => ProductImage::collection($product->images)),
'images' => ProductImage::collection($product->images),
'price' => (double) core()->convertPrice($typeInstance->getMinimalPrice()),
'formatted_price' => core()->currency($typeInstance->getMinimalPrice()),
'special_price' => $this->when(
$typeInstance->haveSpecialPrice(),
(double) core()->convertPrice($typeInstance->getSpecialPrice())
),
'formatted_special_price' => $this->when(
$typeInstance->haveSpecialPrice(),
core()->currency($typeInstance->getSpecialPrice())
),
// 'special_price' => $this->when(
// $typeInstance->haveSpecialPrice(),
// (double) core()->convertPrice($typeInstance->getSpecialPrice())
// ),
// 'formatted_special_price' => $this->when(
// $typeInstance->haveSpecialPrice(),
// core()->currency($typeInstance->getSpecialPrice())
// ),
'regular_price' => $this->when(
$typeInstance->haveSpecialPrice(),
(double) core()->convertPrice($typeInstance->getMaximumPrice())