Star rating in the loop is not accurate

CodeVibrant Forums Easy Mart Star rating in the loop is not accurate

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3903
    dragoeco
    Participant

    Hi there, I see a huge difference with the product star rating between your theme and WooCommerce:

    https://postimg.cc/v1M334Zz

    I fixed the problem by replacing the function add_star_rating() in inc/woocommerce.php, line 415:

    function child_custom_actions() {
        remove_action('woocommerce_after_shop_loop_item_title', 'add_star_rating', 5 ); 
    }
    add_action( 'init' , 'child_custom_actions' );
    
    function add_star_rating_loop(){
    	global $woocommerce, $product;
    	$average = $product->get_average_rating();
    	echo '<div class="star-rating"><span style="width:' . ( ( $average / 5 ) * 100 ) . '%"></span></div>';
    }
    add_action('woocommerce_after_shop_loop_item_title', 'add_star_rating_loop', 5 ); 

    I’m not an expert with PHP but this issue seems to be fixed only by removing the absint() function. I guess there is a good reason if your dev added it into the theme and that’s why I share my “investigation” with you 🙂

    Regards

    Pierre

    #3915
    Anonymous
    Inactive

    Hey there,
    You find out the significant issue. Thank you for this “comment” this will surely help us to improve our product. We will fixed it asap and push you the updates.

    Regards,
    Codevibrant Supprt Team.

    #3924
    dragoeco
    Participant

    Alright, you’re welcome 😉 Happy new years guys!

    #4214
    myrtle.rankind
    Participant

    Happy New Chinese Year guys!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Easter Sale 2021 !! Use Coupon code cveaster21 to get 25% OFF on any of our Premium Themes & Plugins