This topic has 8 replies, 3 voices, and was last updated 5 years, 9 months ago ago by Olga Barlow
My suggestion and issue was i want to display rating option if the product does not any rating and reviews like all stars in grey color in order to give rating.
Currently there is no rating option displaying in the shop page if product doesn’t have any ratings.
Hello,
Add the following code 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>';
}
Regards
Hello Olga,
I have updated the code but it is not reflecting on the site
It’s not showing rating
THANKS AND REGARDS
MOHAMMED
Hello,
Is the child theme activated on your site? Have you cleared all cache?
Please provide temporary wp-admin and FTP access.
Regards
I have done all possible things like clear cache, child theme etc,
Hello,
Provide FTP and Dashboard access to your site. We can’t tell you why this doesn’t work for you without checking the files.
Regards
See in private content area
Hello,
1. Where have you added mentioned code in your child theme? Because functions.php file was the default. Once I added the code I see the rating on the shop page http://prntscr.com/mlvqmt So, don’t understand your issue.
2. You have a problem with the PHP Memory limit http://prntscr.com/mlvofv because what to show all the products http://prntscr.com/mlvrll I would suggest you to choose the grid view and load more button and use the limit 50 products for example, don’t try to show all at once.
Regards
You must be logged in to reply to this topic.Log in/Sign up