Zen Follower
- Join Date:
- Feb 2009
- Posts:
- 121
- Plugin Contributions:
- 0
A simple bit of code to move...keeps crashing! average product rating
Hi,
I am looking to move a bit of code but, no matter what I try it keeps crashing the product info page. If you look at my site i'll try and explain what I'm trying to do:
At the bottom of the page I want the reviews button to be underneath the stars rating. This is the code:
<!--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 ) { ?> <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> <br class="clearBoth" /> <?php // 2P modified BOF - 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>'; // 2P modified EOF - 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())) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?></div> <br class="clearBoth" /> <?php } } ?> <!--eof Reviews button and count -->I've tried moving some code around but nothing seems to work. It seems simple so does anybody have any ideas? Please!!!
Gary :smile: