Forums / General Questions / Review Preview on Product Page

Review Preview on Product Page

Locked

Views: 1,131

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
24 Nov 2009, 7:59 PM
#1
best_price_accessori avatar

best_price_accessori

Zen Follower

Join Date:
Dec 2008
Posts:
155
Plugin Contributions:
0

Review Preview on Product Page

Hey,

I am pretty sure this must be a built in feature but I cannot get it to work.

I would like a preview of the first 5 reviews on the poduct page instead of having to click reviews to read them.

How do I get this to work? :frusty:

Cheers
Daniel!

26 Nov 2009, 3:55 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Review Preview on Product Page

You might be able to adapt this add on ...
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=213

I have not looked at it and it sounds like it shows reviews for the Product on the Product pages ... but if you want "any" 5 reviews, you could probably adapt this or get an idea of what things might need to be done ...

It is older code, but often times that is not an issue ...

Let us know how this works for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Nov 2009, 3:22 PM
#3
best_price_accessori avatar

best_price_accessori

Zen Follower

Join Date:
Dec 2008
Posts:
155
Plugin Contributions:
0

Re: Review Preview on Product Page

I got it working!

Thanks for your advice.

For anyone interested I place the code below into the tpl_product_info_display.php

<!--bof Reviews button and count-->
<?php
  if ($flag_show_product_info_reviews == 1) {
    // if more than 0 reviews, then show reviews button; otherwise, show the "write review" button
    if ($reviews->fields['count'] > 0 ) { ?>
      
<?php
    foreach ($reviewsArray as $reviews) {
?>

<div class="ReviewBy"><?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews['customersName'])); ?><?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews['reviewsRating'] . '.gif'); ?></div><br>
<div class="productReviewsDefaultProductMainContent content"><?php echo zen_break_string(zen_output_string_protected(stripslashes($reviews['reviewsText'])), 60, '-<br />') . ((strlen($reviews['reviewsText']) >= 100) ? '...' : ''); ?></div><br>
   <br class="clearBoth" />
<?php
    }
?>
</div>
<br class="clearBoth" />
<div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_REVIEWS, BUTTON_REVIEWS_ALT) . '</a>'; ?></div>
<?php } else { ?>
<div id="productReviewLink" class="buttonRow back" style="clear:both"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array())) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?></div>
<br class="clearBoth" />
<?php
  }
}
?>
<!--eof Reviews button and count -->
29 Nov 2009, 10:28 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Review Preview on Product Page

Thanks for the update and for posting the solution that worked for you on putting the Reviews on the product _info page ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!