WordPress.org

Forums

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

  1. jpanizzoli
    Member
    Posted 1 year 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 1 year 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 1 year 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 1 year ago #

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

  5. preethamchandra
    Member
    Posted 1 year ago #

    hi jpanizzoli.

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

    Would you kindly share how u did it?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • kk Star Ratings
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.