Notifications
Clear all

wpdiscuz for woocommerce products

8 Posts
2 Users
0 Reactions
6,600 Views
 itlr
(@itlr)
Active Member
Joined: 6 years ago
Posts: 17
Topic starter  

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
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

 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)
Active Member
Joined: 6 years ago
Posts: 17
Topic starter  

Thanks. 

Will [wprating] work in product archive pages?


   
ReplyQuote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

Yes, sure it should work fine. 


   
ReplyQuote
 itlr
(@itlr)
Active Member
Joined: 6 years ago
Posts: 17
Topic starter  

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
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

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)
Active Member
Joined: 6 years ago
Posts: 17
Topic starter  

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
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

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:
Scroll to top