Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Location
    Gex, France
    Posts
    70
    Plugin Contributions
    0

    Default Average Product Rating

    Hi guys,

    Can anyone tell me what to change to get 'Average Product Rating' in 1.3.9g?

    It is displaying on the product page but no matter how many reviews are made the rating always says 0.

    Thanks in advance
    Matt

  2. #2

    Default Re: 138 mods tested on 139

    Quote Originally Posted by Graphic Content View Post
    Hi guys,

    Can anyone tell me what to change to get 'Average Product Rating' in 1.3.9g?

    It is displaying on the product page but no matter how many reviews are made the rating always says 0.

    Thanks in advance
    Matt
    Hi Matt,
    If you haven't figure it out yet...
    You need to merge the mod code from modules/pages/document_general_info/main_template_vars.php
    modules/pages/document_product_info/main_template_vars.php
    modules/pages/product_free_shipping_info/main_template_vars.php
    modules/pages/product_info/main_template_vars.php
    modules/pages/product_music_info/main_template_vars.php
    to the new install one
    the code you need to get is

    PHP Code:
      // 2P added BOF - Average Product Rating
        
    $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);
        
    // 2P added EOF - Average Product Rating 
    copy and paste to those 5 same files name on you ftp arround line 95
    like so
    PHP Code:
    $reviews $db->Execute($reviews_query);
        
           
    // 2P added BOF - Average Product Rating
        
    $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);
        
    // 2P added EOF - Average Product Rating

      
    }

      require(
    DIR_WS_MODULES zen_get_module_directory('product_prev_next.php')); 

 

 

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 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. 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