Review view updated

This commit is contained in:
jitendra 2019-01-04 19:09:27 +05:30
parent 98e2d0e52c
commit e2765b2e1c
3 changed files with 18 additions and 0 deletions

View File

@ -108,6 +108,16 @@ class Product extends Model
return $this->hasMany(ProductImage::class, 'product_id');
}
/**
* The images that belong to the product.
*/
public function getBaseImageUrlAttribute()
{
$image = $this->images()->first();
return $image ? $image->url : null;
}
/**
* The related products that belong to the product.
*/

View File

@ -292,6 +292,7 @@ return [
'description' => 'Description',
'specification' => 'Specification',
'total-reviews' => ':total Reviews',
'total-rating' => ':total_rating Ratings & :total_reviews Reviews',
'by' => 'By :name',
'up-sell-title' => 'We found other products you might like!',
'reviews-title' => 'Ratings & Reviews',

View File

@ -12,6 +12,13 @@
<div class="total-reviews">
{{ __('shop::app.products.total-reviews', ['total' => $total]) }}
{{
__('shop::app.products.total-rating', [
'total_rating' => $reviewHelper->getTotalRating($product),
'total_reviews' => $total,
])
}}
</div>
</div>
@endif