There I no support thread for the Average Product Rating module (https://www.zen-cart.com/downloads.php?do=file&id=398). Creating this one so one will exist going forward..
There I no support thread for the Average Product Rating module (https://www.zen-cart.com/downloads.php?do=file&id=398). Creating this one so one will exist going forward..
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Now that there is a support thread for the Average Product Rating module I have some questions to ask of the community. For the most part the natural works fairly well. However it doesn't seem to display the total reviews count.
I've cheated to work around this by doing the following:
Code:<?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 ?>Then added this to the /includes/languages/YOUR_TEMPLATE/english.php file:Code:<?php // 2P modified BOF - Average Product Rating echo '<p class="reviewCount">'; if ($flag_show_product_info_reviews_count == 1) { echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS_ALT); echo '<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 ?>
This works, but it would be nice to know the right correction.. In the name of full disclosure I am using the TPP module but I do not have the average product reviews displaying inside of tab. The average product reviews are displayed just below the "Add to Cart" button.Code:define('TEXT_DISPLAY_NUMBER_OF_REVIEWS_ALT', '<div style="display: none;">Displaying <strong>%d</strong> to <strong>%d</strong> (of </div>Current Reviews: <strong>%d</strong><div style="display: none;"> reviews)</div>');
Last edited by DivaVocals; 19 Jul 2015 at 09:04 PM.
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Dave
Always forward thinking... Lost my mind!
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Also the display when there are no reviews seems a bit off.. I would expect to see the current reviews count to display (as "0") and the average reviews to not display at all. Instead, this module doesn't display the current reviews and displays the average reviews as "0" with the alt tag for a missing image.
See image links to see what I mean..
APR_1.JPG
APR_2.JPG
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Your image is totally different then mine so may be a bit confusing... I modified the layout and code a bit to get what I wanted..
This is what's under the button...
To save space, I only use words if there are reviews!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="center"> <?php // 2P modified BOF - Average Product Rating if ($flag_show_product_info_reviews_count == 1) { $stars_image_suffix = str_replace('.', '_', zen_round($reviews_average_rating->fields['average_rating'] * 2, 0) / 2); $average_rating = zen_round($reviews_average_rating->fields['average_rating'], 2); echo zen_image(DIR_WS_TEMPLATE . 'images/rat_' . $stars_image_suffix . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $average_rating)) . '<br />Based on '. $reviews->fields['count'] . ' Reviews</div>'; } else { echo ''; } // 2P modified EOF - Average Product Rating ?> <?php } else { ?> <div id="productReviewLink" class="center"><?php echo zen_image(DIR_WS_TEMPLATE . 'images/rat_0.gif', 'No reviews!') ; ?></div> <?php } } ?>
image1
scr1.png
image2
scr2.png
Dave
Always forward thinking... Lost my mind!
http://www.targetmarts.com/gucci-476...-handbag-p-495
hello,i used this module,but it can't use,help me please.
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
Bookmarks