Forums / Templates, Stylesheets, Page Layout / How to display review number even only 1 review?

How to display review number even only 1 review?

Views: 1,407

Results 1 to 4 of 4
10 Jan 2015, 7:56 AM
#1
scott_ease avatar

scott_ease

New Zenner

Join Date:
Jun 2012
Posts:
68
Plugin Contributions:
2

How to display review number even only 1 review?

Greetings-

When there are more than 1 product reviews, the text "Displaying 1 to % (of % reviews)" will show at the bottom of review section. But if there is only 1 review, the text won't show up. (When no review, the text "There are currently no product reviews" will be there.)

How to show the text when there is only one review?

I think the file 'tpl_product_reviews_default.php' need to customized, but I don't know how. URL:
(more than 1 review) http://www.angelcorp.cn/index.php?main_page=product_info&cPath=57&products_id=92
(only 1 review) http://www.angelcorp.cn/index.php?main_page=product_info&cPath=58&products_id=93
(no review) http://www.angelcorp.cn/index.php?main_page=product_info&cPath=59&products_id=94

Thank you.

10 Jan 2015, 1:53 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to display review number even only 1 review?

I may not understand your question, but the default Zencart behavior seems to make the most sense to me. Why do you want to tell your visitors that there is only one review when they can see that for themselves on the page?

11 Jan 2015, 4:25 AM
#3
scott_ease avatar

scott_ease

New Zenner

Join Date:
Jun 2012
Posts:
68
Plugin Contributions:
2

Re: How to display review number even only 1 review?

It looks better in that way. Otherwise it's blank in that place. Better appearance is also a goal when building website. Thanks.

13 Jan 2015, 5:52 AM
#4
scott_ease avatar

scott_ease

New Zenner

Join Date:
Jun 2012
Posts:
68
Plugin Contributions:
2

Re: How to display review number even only 1 review?

Figured out. Edit file '/includes/templates/YOUR_TEMPLATE/templates/tpl_product_reviews_default.php'
Change ($reviews_split->number_of_rows > 0) into ($reviews_split->number_of_rows > 1) and add an 'elseif ($reviews_split->number_of_rows > 0)...' clause.

<?php } if (($reviews_split->number_of_rows > 1) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <hr /> <div id="productReviewsDefaultListingBottomNumber" class="navSplitPagesResult"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></div> <div id="productReviewsDefaultListingBottomLinks" class="navSplitPagesLinks"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'main_page'))); ?></div> <?php } elseif (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <hr /> <span id="productReviewsDefaultListingBottomNumber" class="navSplitPagesResult"><?php echo ' YOUR_OWN_TEXT ' ; ?> </span> <?php } ?>