Guest commenting on WooCommerce product page  

  RSS

rumo
 rumo
(@rumo)
New Member
Joined: 9 months  ago
Posts: 1
15/12/2017 7:57 pm  

I want to allow only registered users to comment on a product page.

However, because of wpDisquz takes into account WooCommerce and it's settings it has different logic.

So either Guests are always able to comment no matter my form settings or no one can comment until they have purchased a product. 

The problem is in isUserCanComment  function in Form.php. Basically because of WooCommerce the form's restrictions are ignored.

I don't think WooCommerce logic should be there for plain wpDiscuz plugin. Or at least there should be some filters to workaround it.

Please, can you look at it.


ReplyQuote
Tom
 Tom
(@tomson)
Support Team Admin
Joined: 3 years  ago
Posts: 2744
15/12/2017 11:04 pm  

Please navigate to Dashboard > Comments > Forms admin page, edit the Default Form and uncheck/disable "Allow Gust Commenting" option for the post type you want. Then delete all caches and do Ctrl+F5 as guest on front-end.


ReplyQuote
nick
 nick
(@nick)
New Member
Joined: 9 months  ago
Posts: 2
20/12/2017 3:26 am  

I'm trying to solve the same problem as well. Tom, even when I unchecked the "Allow Guest Commenting" option in the Default Form, it still allows guest comments on Woocommerce products.

It appears the isUserCanComment() function in wpdiscuz/forms/wpdFormAttr/Form.php returns TRUE unless Woocommerce comments are restricted to only those who purchased the product (as rumo indicated above).

Any chance you can fix this in an update?


ReplyQuote
Tom
 Tom
(@tomson)
Support Team Admin
Joined: 3 years  ago
Posts: 2744
20/12/2017 8:46 pm  

Hi nick,

I don't know what's wrong on your website, this option works well on all our tested websites. Nothing wrong with isUserCanComment() function. We could check this problem if you send admin login details to support[at]gvectors.com admin page.


ReplyQuote
nick
 nick
(@nick)
New Member
Joined: 9 months  ago
Posts: 2
24/12/2017 3:37 am  

Tom, thanks for the response.

I just created a brand new Wordpress install, and installed fresh installs of both WooCommerce and wpDiscuz and am still having the same issue when I disable guest commenting - guests are correctly blocked on normal posts, but aren't blocked on WooCommerce product pages. I've emailed details of the fresh install to the support email address.


ReplyQuote
Tom
 Tom
(@tomson)
Support Team Admin
Joined: 3 years  ago
Posts: 2744
29/12/2017 12:11 am  

Ok, we found the bug. This is already fixed. Please wait for the next wpDiscuz release.

In case you need fix it urgently, you should change in /wpdiscuz/forms/wpdFormAttr/Form.php file (line 738):

if (class_exists('WooCommerce') && get_post_type($post->ID) == 'product') 

to this:

if ($user_can_comment && class_exists('WooCommerce') && get_post_type($post->ID) == 'product')

 


ReplyQuote
Share: