WordPress.org

Ready to get started?Download WordPress

Forums

WP Customer Reviews
Overall ratings in new version. When? (5 posts)

  1. pbm160
    Member
    Posted 1 year ago #

    Overall ratings is a much needed feature that has been asked many times but there is no clear answers so far. It really should be included in this plugin.

    Are the developpers interested in adding this feature at all?

    In the meantime is there an easy way for non coder to get the overall ratings stars to be shown on same page and/or on a different page using a shortcode that could be then inserted anywhere on a post?

    Does someone know how to do it?

    http://wordpress.org/extend/plugins/wp-customer-reviews/

  2. kartguru
    Member
    Posted 1 year ago #

  3. thowe82
    Member
    Posted 1 year ago #

    Hello,

    well, I think it's a good question to ask for overall-ratings. Sadly, the link doesn't work anymore.

    Can anybody help me?

    Greets, T.

  4. kartguru
    Member
    Posted 1 year ago #

    Damn :(

    Hope this helps then ... it appears to look like this.

    global $wpdb;
    $pId = $post->ID; //if using in another page, use the ID of the post/page you want to show ratings for.
    $row = $wpdb->get_results("SELECT COUNT(*) AS <code>total</code>,AVG(review_rating) AS <code>aggregate_rating</code>,MAX(review_rating) AS <code>max_rating</code> FROM wp_2_wpcreviews WHERE <code>page_id</code>= $pId AND <code>status</code>=1");
    $max_rating = $row[0]->max_rating;
    $aggregate_rating = $row[0]->aggregate_rating;
    $total_reviews = $row[0]->total;
    $totl = $aggregate_rating * 20;
    $wpdb->flush();

    For a visual display

    <div class="sp_rating" id="wpcr_respond_1"><div class="base">
        <div style="width: <?php echo $totl;?>%" class="average"></div></div><?php echo ' ' ?><br/>
        <?php echo "Rating: <strong>" . (round ($aggregate_rating,1)) . "</strong>/5 (" . $total_reviews . " votes cast)";?></span></p>

    In text form

    Average score of <?php echo (round ($aggregate_rating,1)) . " for " . $total_reviews . " reviews.";?>

    & for my multi-site install I had to rename the database to "wp_2_wpcreviews" where 2 is the site #

    I think that was it. I have it running on the homepage & on the single page too. Works a treat

  5. gowebsol
    Member
    Plugin Author

    Posted 1 year ago #

    Hi all. Yep, we are working on an overall ratings function for the new Pro version. Look for an announcement in the next week on Ver3, both free and paid :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic