Home Forums WoodMart support forum ADD review start on product grid by default

ADD review start on product grid by default

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #398599

    riscanuc@gmail.com
    Participant

    Hi,

    How can I add review starts by default (I don’t have reviews, to be grey) for products grid which don’t have reviews.

    Attachments:
    You must be logged in to view attached files.
    #398671

    riscanuc@gmail.com
    Participant

    I’m using this code to display rating option if the product does not any rating and reviews like all stars in grey color in order to give rating in child theme -> functions.php

    remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
    add_action('et_after_shop_loop_title', 'get_star_rating' );
    function get_star_rating()
    {
        global $woocommerce, $product;
        $average = $product->get_average_rating();
    
        echo '<div class="star-rating"><span style="width:'.( ( $average / 5 ) * 100 ) . '%"><strong itemprop="ratingValue" class="rating">'.$average.'</strong> '.__( 'out of 5', 'woocommerce' ).'</span></div>';
    }

    but still i’m not able to see the review grey starts.

    #398760

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    You don’t need to add any code. Please Go to Theme Settings >> Products Archive >> Product Styles and enable the option.

    Screenshot: https://gyazo.com/bcfc21674f277b8a5786c560def4a127

    Best Regards

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)