wpdiscuz for woocommerce products  

  RSS

itlr
 itlr
(@itlr)
Active Member
Joined: 4 months ago
Posts: 13
29/03/2019 5:27 am  

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?


Quote
Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 2892
29/03/2019 12:29 pm  

 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. 


ReplyQuote
itlr
 itlr
(@itlr)
Active Member
Joined: 4 months ago
Posts: 13
29/03/2019 2:00 pm  

Thanks. 

Will [wprating] work in product archive pages?


ReplyQuote
Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 2892
29/03/2019 2:06 pm  

Yes, sure it should work fine. 


ReplyQuote
itlr
 itlr
(@itlr)
Active Member
Joined: 4 months ago
Posts: 13
29/03/2019 3:01 pm  

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.


ReplyQuote
Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 2892
29/03/2019 3:09 pm  

Could you please specify exactly what doesn't work? 

I'm sorry, but there is no documentation for this yet. 

https://gvectors.com/forum/important-information-and-announcements/wpdiscuz-4-0-7-is-released/#post-4467


ReplyQuote
itlr
 itlr
(@itlr)
Active Member
Joined: 4 months ago
Posts: 13
30/03/2019 2:51 am  

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.

ReplyQuote
Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 2892
30/03/2019 2:55 pm  

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']');
}

ReplyQuote
Share: