Zen Cart Logo

Reviews Area

Locked

Views: 522

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
1 Apr 2010, 4:09 AM
#1
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Reviews Area

I have been messing with this all day and just can not seem to get it :(

The code that controls what I'm trying to do is this:

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 ) { ?>
<div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params()) . '">' . Read_all_reviews . '</a>'; ?></div><!--. zen_image_button(BUTTON_IMAGE_REVIEWS, BUTTON_REVIEWS_ALT) .-->
<!--<br class="clearBoth" />-->

<?php //bof added code per Average Product Rating
         echo '<p class="reviewCount">';
         if ($flag_show_product_info_reviews_count == 1) {
           //echo TEXT_CURRENT_REVIEWS . ' <strong>' . $reviews->fields['count'] . '</strong><br />';
           $stars_image_suffix = str_replace('.', '_', zen_round($reviews_average_rating->fields['average_rating'] * 2, 0) / 2); // for stars_0_5.gif, stars_1.gif, stars_1_5.gif etc.
           $average_rating = zen_round($reviews_average_rating->fields['average_rating'], 2);
           echo TEXT_CURRENT_REVIEWS_RATING . ' <strong>' . $average_rating . '</strong> ' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $stars_image_suffix . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $average_rating));
         } else {
           echo '';
         }
         echo '</p>';
       ?><!--eof added code per Average Product Rating-->
<?php } else { ?>
<div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array())) . '">' . Write_a_review . '</a>'; ?></div><!--zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT)-->

I am trying to move the 'Customer review' above the 'Read all reviews' link and then add a 'Write a Reviews' link next to 'Read all reviews'.

It would be great if a fresh pair of eyes can look at it for me and show me what I've been doing wrong.

1 Apr 2010, 4:19 AM
#2
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Reviews Area

Also in addition to that,

I've installed dgReviews (places the reviews of the product on the product info page) and it works fine. The only minor thing I would like to add to it is to make the 'Read all reviews' link at the top of the page (in code above) an anchor link to the 'Heading' area I made for the reviews at the bottom of the page. Does anyone know how to do that?

So basically when a customer clicks on the 'Read all reviews' link, they will simply be taken to the bottom of the page where the reviews are INSTEAD of being taken to another page (which is how the 'Read all reviews' link currently works).

Thanks very much.