Giúp mình với, mình tham khảo website như hình dưới, nó hiển thị star-rating (kết quả đánh giá) ngay cả khi không có đánh giá nào cả. Làm sao để hiển thị được cái này giúp mình với. Mình muốn dù có đánh giá star-rating hay không nó vẫn hiển thị lên thì làm như thế nào ? trong woocommerce ý mọi người. Câu hỏi tiếng anh: Show star-rating while null in woocommerce, How to display Empty Stars when 0 reviews, Display blank(0) star ratings in the Woocommerce, Woocommerce always show stars – even with no reviews
Bạn add code sau vào tập tin function.php của themes nhé: PHP: // always display rating starsfunction itseovn_filter_woocommerce_product_get_rating_html( $rating_html, $rating, $count ) { $rating_html = '<div class="star-rating">'; $rating_html .= wc_get_star_rating_html( $rating, $count ); $rating_html .= '</div>'; return $rating_html;}; add_filter( 'woocommerce_product_get_rating_html', 'itseovn_filter_woocommerce_product_get_rating_html', 10, 3 );