I'm using wpdiscuz comment form for all my woocommerce products. With that, I'd like to show ratings and review counts for each product in the product listing pages. Is that still possible or do I have to disable wpdiscuz and revert back woocommerce's default rating & review system?
wpDiscuz has the [wpdrating] shortcode for Post Rating
Here is the shortcode attributes:
- metakey="all"
- show-lable = true/false
- show-count = true/false
- show-average = true/false
- itemprop = true/false
Full shortcode example:
[wpdrating metakey="all" show-lable = true show-count = true show-average = true itemprop = true ]
You should youse this shortecode to display the ratings for each product.
Thanks.
Will [wprating] work in product archive pages?
Yes, sure it should work fine.
Yes it works, but shortcode properties don't seem working for me
- show-label
- show-count
- show-average
Could you refer me to the documentation of the shortcode? I'd like to look closer. Not sure what I'm doing wrong.
Thanks.
Could you please specify exactly what doesn't work?
I'm sorry, but there is no documentation for this yet.
My code
add_action( 'woocommerce_shop_loop_item_title', 'custom_action', 15 );
function custom_action() {
echo do_shortcode('[wpdrating]');
}
The rating stars don't show up.
Hi @itlr,
It seems the post ID is not visible there, try this one. Don't forget to change the red marked code before using:
add_action( 'woocommerce_shop_loop_item_title', 'custom_action', 15 );
function custom_action() {
echo do_shortcode('[wpdrating post_id='current_post_id']');
}