WordPress.org

Ready to get started?Download WordPress

Forums

kk Star Ratings
The sum of multiple ratings? (5 posts)

  1. jpanizzoli
    Member
    Posted 9 months ago #

    I'm using shortcode to gather multiple ratings on one page, ie:

    Product 1 [kkstarratings id="1"]

    Product 2 [kkstarratings id="2"]

    Product 3 [kkstarratings id="3"]

    Each rating is working correctly and gathering data individually. Is there a way to take the sum of these rating values to create an "average" or overall rating for all the products on this page?

    ie: average of rating id=1, id=2 and id=3

    THANKS FOR YOUR HELP!

    http://wordpress.org/plugins/kk-star-ratings/

  2. Kamal Khan
    Member
    Plugin Author

    Posted 9 months ago #

    You can do that if you use custom code in your theme. check the help section in the settings page of the plugin as a starting guide

  3. Kamal Khan
    Member
    Plugin Author

    Posted 9 months ago #

    $post1 = get_post_meta(1, 'kksr_avg', true);
    $post2 = get_post_meta(2, 'kksr_avg', true);
    $post3 = get_post_meta(3, 'kksr_avg', true);
    
    $avg = ($post1 + $post2 + $post3) / 3;
  4. jpanizzoli
    Member
    Posted 8 months ago #

    Thanks for the info... I'll look into this in more detail when I have a chance ;)

  5. preethamchandra
    Member
    Posted 5 months ago #

    hi jpanizzoli.

    I wanted to have multiple Rating in single post/page.

    Would you kindly share how u did it?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.