Answer the question
In order to leave comments, you need to log in
How to display rating stars above a short description?
How to display rating stars above a short description? Shown in catalog but not here. In the css of the theme, I did not find it to be disabled. How are they displayed by default?
Answer the question
In order to leave comments, you need to log in
The question is not clear, the amount of which should be more?
SELECT t1.email
FROM " . DB_PREFIX . "stock AS t1
INNER JOIN product ON (product_id = '" . (int) $product_id."' AND status = 0)
add_filter('woocommerce_product_get_rating_html', 'themename_get_rating_html', 10, 2);
function themename_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;
}
It looks like I really have styles turned off, since not only the stars do not work, but also other elements .. Is there a way to turn it on?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question