Post by vssoft » Mon Mar 12, 2018 1:21 pm

Hi,

I want to show total Average Ratings & total count of reviews on top of 'Review Tab' on product page.

I have tried to add below code in Review.tpl (same as product.tpl) but it don't works:

Code: Select all

<div class="review">
<span class="rating_stars rating r<?php echo $rating; ?>">
<i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
 </span>
<a class="to_review" ><?php echo $reviews; ?></a>
</div>
What changes required to show total count of reviews & star rating on Review Tab. Using opencart 2.0.3

Thanks

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by straightlight » Tue Mar 13, 2018 4:54 am

Any URL you could share?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Tue Mar 13, 2018 10:00 pm


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by vssoft » Wed Mar 14, 2018 8:08 pm

Thanks for reply

But i want to show only count of reviews & ratings on 'Review Tab' on product page.

For e.g: Message appear on Reviews Tab on top

Overall Rating of Product is : ... (whatever the ratings shown as Stars)
based on X (count of reviews) reviews by buyers.

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by straightlight » Wed Mar 14, 2018 9:24 pm

What is the precise OC 4 decimals version you are using?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by vssoft » Wed Mar 14, 2018 10:23 pm

It is default opencart (2.0.3) review system integrated with custom theme and I am trying to show the overall rating of product with total count of reviews on Product > Review Tab by inserting same code of product.tpl but it not works.

Please refer image: https://prntscr.com/ir43vk

Thanks

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by saeedahmed » Tue Sep 03, 2019 4:56 pm

Find product.php and then find review fucntion and add this line of code


// Get Product Aggregate Rating

$this->load->model('catalog/product');

$product_info = $this->model_catalog_product->getProduct($this->request->get['product_id']);

$data['ratingall'] = (int)$product_info['rating'];

// Get Product Aggregate Rating

Newbie

Posts

Joined
Sat Oct 13, 2018 3:27 pm
Who is online

Users browsing this forum: No registered users and 279 guests