Post by JAZEE » Tue Nov 01, 2011 9:48 am

For opencart version 1.5.1 : How do I show zero Review icons on product-list? Just like the one on the picture shown below. I've tried to copy the codes from product.php but I can not seem to make it work. Basically I want the Review icons to shop up even though there are no reviews submitted, for each individual items on the product list and product grid. It seems to work for the product information page. I think it's just the matter of copying the codes from the product.php file and pasting it to category.php file but in a correct order or in words. Please help because I've got nobody else to go to for help! Thank you!

The image: the first product seems to have zero reviews yet it still shows up as gray icons. I want it like that. If idon't get support then I think I'll have to spend more time and figure it out, I've spent like two days already :( . Pleaseeeeeeeee Help...Thank you!

Attachments

rating-review.png

rating-review.png (63.23 KiB) Viewed 852 times


Newbie

Posts

Joined
Sat Dec 25, 2010 8:45 pm

Post by wernerrenrew » Tue Nov 01, 2011 2:09 pm

Hi,

catalog/view/theme/ 8) your_theme/template/product/category.tpl
replace line 90-92

Code: Select all

<?php if ($product['rating']) { ?>
      <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
      <?php } ?>
with this

Code: Select all

<?php if ($product['rating']) { ?>
      <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
      <?php }else{ ?>
      <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="0 reviews." /></div>
      <?php } ?>

User avatar
Active Member

Posts

Joined
Thu Oct 27, 2011 9:48 pm
Location - Netherlands

Post by sans » Tue Nov 01, 2011 2:24 pm

Alternative code:
1. Open category.tpl in catalog/view/theme/your_theme/product/category.tpl:
2. Find :

Code: Select all

<?php if ($product['rating']) { ?>
      <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
      <?php } ?>
3. Replace with :

Code: Select all

<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>

kaos jersey, jersey bola, baju bola, baju bola terbaru, baju bola murah


Active Member

Posts

Joined
Tue Dec 07, 2010 9:18 am

Post by JAZEE » Wed Nov 02, 2011 3:10 am

Thank veryyyyyyy much guys ( wernerrenrew and sans ). Both of the solution above works perfectly. So you only had to change the codes from the category.tpl...I was changing codes both from category.tpl AND category.php...well I tried to copy codes similar to product.tpl and product.php....but yeah I learn from my mistake...thank you guys.

Newbie

Posts

Joined
Sat Dec 25, 2010 8:45 pm
Who is online

Users browsing this forum: No registered users and 45 guests