Merge pull request #427 from jitendra-webkul/jitendra

Review view updated
This commit is contained in:
JItendra Singh 2019-01-04 19:10:40 +05:30 committed by GitHub
commit 14760df0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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'); 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. * The related products that belong to the product.
*/ */

View File

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

View File

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