Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Location
    UK
    Posts
    85
    Plugin Contributions
    0

    Default Average Product Rating need help on it

    I have just added this (Average Product Rating) but nothing has appeared has anyone used this add-on I am running v1.3.9g is anyone using this if so how have you installed it.

  2. #2
    Join Date
    May 2008
    Location
    UK
    Posts
    85
    Plugin Contributions
    0

    Default Re: Average Product Rating need help on it

    Any one?.

  3. #3
    Join Date
    Nov 2008
    Location
    Gex, France
    Posts
    70
    Plugin Contributions
    0

    Default Re: Average Product Rating need help on it

    Hey RedRob,

    I have added this mod to the latest Zen and it is displaying but the average rating on the product page isn't updating for some reason! I have given a product 2 ratings but it still says average rating 0.

    I really need this to work for my client so will be investigating further.

    Are you getting nothing at all?

    Matt

  4. #4
    Join Date
    Nov 2008
    Location
    Gex, France
    Posts
    70
    Plugin Contributions
    0

    Default Re: Average Product Rating need help on it

    right I have got this working. For some reason the Main_vars file was not outputting the data correctly so by moving the functions directly into the tpl_product_info_display it now works.

    here is the code to add to your tpl_product_info_display.php file wherever you want it to appear. (this works in 1.3.9g)

    PHP Code:
    <!--bof Reviews button and count-->
    <?php
      
    if ($flag_show_product_info_reviews == 1) {
      
      
    $reviews_average_rating_query "select avg(reviews_rating) as average_rating from " TABLE_REVIEWS " r, "
                                                               
    TABLE_REVIEWS_DESCRIPTION " rd
                               where r.products_id = '" 
    . (int)$_GET['products_id'] . "'
                               and r.reviews_id = rd.reviews_id
                               and rd.languages_id = '" 
    . (int)$_SESSION['languages_id'] . "'" .
                               
    $review_status;
            
            
    $reviews_average_rating $db->Execute($reviews_average_rating_query);
      
        
    // if more than 0 reviews, then show reviews button; otherwise, show the "write review" button
        
    if ($reviews->fields['count'] > ) { ?>
    <div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' zen_href_link(FILENAME_PRODUCT_REVIEWSzen_get_all_get_params()) . '">' zen_image_button(BUTTON_IMAGE_REVIEWSBUTTON_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'] * 20) / 2); // for stars_0_5.gif, stars_1.gif, stars_1_5.gif etc.
        //echo "raw average:".$reviews_average_rating->fields['average_rating']." | ";
        //echo $reviews_average_rating_query;
        
    $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_WRITEzen_get_all_get_params(array())) . '">' zen_image_button(BUTTON_IMAGE_WRITE_REVIEWBUTTON_WRITE_REVIEW_ALT) . '</a>'?></div>
    <br class="clearBoth" />
    <?php
      
    }
    }
    ?>
    <!--eof Reviews button and count -->
    hope this helps
    Matt

 

 

Similar Threads

  1. Average Product Rating (Support Thread)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 16 Mar 2018, 04:01 PM
  2. Average Product Rating
    By Graphic Content in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 May 2011, 06:58 PM
  3. Average Product Rating mod
    By kamphuis in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 27 Aug 2010, 01:31 AM
  4. A simple bit of code to move...keeps crashing! average product rating
    By plymgary1 in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 9 Mar 2010, 08:53 AM
  5. 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

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