Merge remote-tracking branch 'dummy/patch-1' into dummy-1
Merged
This commit is contained in:
commit
43457b225e
|
|
@ -31,6 +31,8 @@ class Product extends JsonResource
|
|||
{
|
||||
$product = $this->product ? $this->product : $this;
|
||||
|
||||
$prices = $product->getTypeInstance()->getProductPrices();
|
||||
|
||||
return [
|
||||
'id' => $product->id,
|
||||
'type' => $product->type,
|
||||
|
|
@ -56,6 +58,8 @@ class Product extends JsonResource
|
|||
$product->getTypeInstance()->haveSpecialPrice(),
|
||||
core()->currency($product->getTypeInstance()->getSpecialPrice())
|
||||
),
|
||||
'regular_price' => data_get($prices, 'regular_price.price'),
|
||||
'formated_regular_price' => data_get($prices, 'regular_price.formated_price'),
|
||||
'reviews' => [
|
||||
'total' => $total = $this->productReviewHelper->getTotalReviews($product),
|
||||
'total_rating' => $total ? $this->productReviewHelper->getTotalRating($product) : 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue