Post by John2810 » Mon Sep 16, 2013 1:11 pm

Hi all,

Is there anyway to hide the showing of "0 reviews", but show reviews when available?

Image

I'm using the default theme.

I'm thinking the code has something to do with the following in product.tpl, line 251 but not sure how to tweak it.

Code: Select all

  <?php if ($review_status) { ?>
    <a href="#tab-review"><?php echo $tab_review; ?></a>
    <?php } ?>

New member

Posts

Joined
Tue Feb 19, 2013 5:37 pm

Post by MarketInSG » Mon Sep 16, 2013 3:17 pm

Quickest way is to find

Code: Select all

<?php if ($review_status) { ?>
and replace with

Code: Select all

<?php if ($review_status && filter_var($reviews, FILTER_SANITIZE_NUMBER_INT) > 0) { ?>


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by John2810 » Mon Sep 16, 2013 5:22 pm

Thanks!

New member

Posts

Joined
Tue Feb 19, 2013 5:37 pm

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by matt.sapcote » Tue Feb 16, 2016 4:00 pm

I'm looking to implement this in OC 1.5.6, Journal 2 theme, would it still work? And would I need to add the extra code to the top product info where stars are also displayed?

EDIT: Still works great for the header part, hiding the tab is proving more difficult.

EDIT 2: Ok done, you have to use the code on both the tab label, as well as the tab content.

So the review_status replacement above the following lines:

<a href="#tab-review"><?php echo $tab_review; ?></a>
<div id="tab-review" class="tab-content">

Ecommerce SEO Expert.

http://matt-jackson.com


New member

Posts

Joined
Wed Jan 09, 2013 12:18 am
Who is online

Users browsing this forum: Amazon [Bot] and 21 guests