Added regular/final price to the product resource

Added regular and final price to the product resource so that it is much easier to compare between them on the frontend
This commit is contained in:
Afaz Khatri 2020-10-07 11:08:10 +05:30 committed by GitHub
parent ecc87fb72f
commit a97107ac23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -56,6 +56,7 @@ class Product extends JsonResource
$product->getTypeInstance()->haveSpecialPrice(),
core()->currency($product->getTypeInstance()->getSpecialPrice())
),
$product->getTypeInstance()->getProductPrices(),
'reviews' => [
'total' => $total = $this->productReviewHelper->getTotalReviews($product),
'total_rating' => $total ? $this->productReviewHelper->getTotalRating($product) : 0,