Woo add rating to all products
add_action('woocommerce_after_shop_loop_item', 'add_star_rating' ); function add_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>'; }
9 Related pages
- Woo add rating to all products
- Woo get category name by id
- Woo Show all products
- WooCommerce change item title position
- Woocommerce import sample data in woocommerce (with Product Images)
- WooCommerce number of products displayed per page
- WooCommerce product loop
- WooCommerce replace h2 from product-title
- WooCommerce shop page loop