Home Forums WoodMart support forum Product rating

Product rating

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #244387

    sushfambeauty
    Participant

    Please tell me, is it possible to transfer the rating to these places?

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

    Hello,

    Unfortunately, the is no option and it cannot be done with the CSS either. Please consider using a different hove design.

    Best Regards

    #244452

    sushfambeauty
    Participant

    is it possible to display the stars of the rating even if there are no reviews?
    I’m just trying to achieve an even table, because if there is a review on some product, rating stars appear and everything goes down

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

    Hello,

    Unfortunately, our theme does not have such an option.

    It is not to add with CSS as all the elements have the same set of classes and the styles would be applied to all the products, even those that have reviewed.

    Best Regards

    #244644

    sushfambeauty
    Participant

    I found a way to fix the situation by displaying empty stars by adding code to the functions.php of the child theme

    add_filter('woocommerce_product_get_rating_html', 'your_get_rating_html', 10, 2);
      function your_get_rating_html($rating_html, $rating) {
        if ( $rating > 0 ) {
          $title = sprintf( __( 'Rated %s out of 5', 'woocommerce' ), $rating );
        } else {
          $title = 'Not yet rated';
          $rating = 0;
        }
        $rating_html  = '<div class="star-rating" title="' . $title . '">';
        $rating_html .= '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%"><strong class="rating">' . $rating . '</strong> ' . __( 'out of 5', 'woocommerce' ) . '</span>';
        $rating_html .= '</div>';
        return $rating_html;
      }
    #244805

    Hello,

    That is fine. If you have any questions please feel free to contact us.

    Best Regards

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