Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Average Product Rating (Support Thread)

    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.

  2. #2
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Average Product Rating (Support Thread)

    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 ?>
    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 ?>
    Then added this to the /includes/languages/YOUR_TEMPLATE/english.php file:
    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>');
    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.
    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.

  3. #3
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Average Product Rating (Support Thread)

    Quote Originally Posted by DivaVocals View Post

    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.
    I use this mod too and it does display the count, but I've also moidifed it so can't say right now how to do it... when I get home from the North Fire I can take a look and post what I did. I also have it after the cart buttons.
    Dave
    Always forward thinking... Lost my mind!

  4. #4
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Average Product Rating (Support Thread)

    Quote Originally Posted by davewest View Post
    I use this mod too and it does display the count, but I've also moidifed it so can't say right now how to do it... when I get home from the North Fire I can take a look and post what I did. I also have it after the cart buttons.
    Fantastic Dave!!!!
    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.

  5. #5
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Average Product Rating (Support Thread)

    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.

  6. #6
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Average Product Rating (Support Thread)

    Quote Originally Posted by DivaVocals View Post
    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.
    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...
    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  
      } 
    } 
    ?>
    To save space, I only use words if there are reviews!

    image1
    scr1.png

    image2
    scr2.png
    Dave
    Always forward thinking... Lost my mind!

  7. #7
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Average Product Rating (Support Thread)

    Both my flexible centerbox and sidebox plugins come with a version of average rating. Might wanna take a look, easy to place anywhere by replacing one line of code to $_GET['products_id'] and requiring the tpl file.

    Just a thought!

    Quote Originally Posted by DivaVocals View Post
    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

  8. #8

    Default Re: Average Product Rating (Support Thread)

    Quote Originally Posted by DivaVocals View Post
    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..
    http://www.targetmarts.com/gucci-476...-handbag-p-495
    hello,i used this module,but it can't use,help me please.

  9. #9
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Average Product Rating (Support Thread)

    Quote Originally Posted by targetmarts View Post
    http://www.targetmarts.com/gucci-476...-handbag-p-495
    hello,i used this module,but it can't use,help me please.
    What is the problem? apart from the missing star image, the module will not do anything unless you have reviews for the product you linked to.

 

 

Similar Threads

  1. Average Product Rating
    By Graphic Content in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 May 2011, 06:58 PM
  2. Average Product Rating need help on it
    By redrob in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 29 Oct 2010, 11:06 AM
  3. Average Product Rating mod
    By kamphuis in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 27 Aug 2010, 01:31 AM
  4. Average Rating in Search Results or Product Listing
    By hungoveragain in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 26 Oct 2009, 10:11 AM
  5. Average Weight Per Unit Shipping Support Thread
    By numinix in forum Addon Shipping Modules
    Replies: 3
    Last Post: 12 Mar 2009, 02:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR