Skip Navigation

[Resolved] Hide Woocommerce products from Guests

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to hide a specific woocommerce product with our plugins and not allow it to show in the shop page.

Solution:
Unfortunately even if product is marked as restricted it will still show on the product page but the user won't be able to view the actual product.

What you can do is try this plugin s2 Member (Free)

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 2 voices.

Last updated by dmitryK-2 5 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1111485
pic2.png
pic1.png

I am trying to:
Hi, Hide Woocommerce product (ID= 207830 ) from Guests who are visiting woocommerce storefront page (soapmaker.pro/gallery) and single product page (hidden link). No luck.
Link to a page where the issue can be seen:
soapmaker.pro/gallery or hidden link
I expected to see:
Hidden product for guest users visiting this pages. I've made redirect for login page.
Instead, I got:
Product is seen instead for non-registred users. Interesting that in case I disable 'Read' parameter in Access page for Products - it hides all products from catalogue for Guests, but can't work fine in can I enable the combination that Guests can see all (pic1) but those products in exception group 'WC_SpecVol' (pic2)

#1111620

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dmitry,

Thank you for contacting our support forum.

Would you mind allowing me to have admin access to the site to check on this for you ?

The private fields will be enabled for your next response.

Thanks,
Shane

#1112260

Hi, any updates?

#1112283

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dmitry,

I took a look at this for you.

You want to hide a specific product from the guests and not all the products right ?

Thanks,
Shane

#1112779

Yep, product ID 207830 should be hidden from Guests (Non-registred) role.

#1113044

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dmitry,

If you add a different post to the field group i.e a non product item does the issue still remains ?

Also it could be that its being caused by the permalink structure but please check this by assigning a regular post to the field group and see if you can access it.

Thanks,
Shane

#1113486

Yep, looks like this;
I have created test post ( hidden link ) and assigned it to the same authorisation group ('WC_SpecVolume').

Result:
It is still shown in Posts Archive page (hidden link) for guests. But redirected to logon page (as according to the settings of authorisations restrictions) while I try to see details as guest. I have an explanation of this - post archive have an special plugin inside page that controls the post output, and it have not support for Toolset authorisations. Thats ok, I have nothing to hide within News. I need to fix Products.

So still no luck for Products. Can't hide them from Guests. I have a special enhancement that creates product ID same as SKU (that is plugin WooCommerce Product SKU Generator) but it works only in creation of Wocommerce Product.

Another thing written in .htaccess makes page url with sku, I've disabled it - stiil no luck!

# BEGIN WC SKU post meta in permalink (note: requires code in functions.php as well)
<IfModule mod_rewrite.c>
	RewriteEngine On
    RewriteBase / 
    RewriteRule ^whisky/([A-Za-z0-9-_]+)/([A-Za-z0-9-_]+)/?$ ?sku=$1&product=$2 [NC,L]
    </IfModule>
# END WC SKU post meta in permalink 
#1113487

Still the aim - is ti HIDE products from /SHOP/ page from guests

#1114533

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dmitry,

I've tested this on a local copy of a woocommerce site.

It doesn't seems that it will be possible to hide the product from the guests using the post group method. I believe this is because woocommerce itself is pulling the information from the database and access only intercepts it when the item is actually clicked on.

Thanks,
Shane

#1115533

Dear Shane, that sounds very sad. Don't you think this that I have to use another plugins to cover this woocommerce issue ? Is it possible to add this functionality to Toolset Access in next releases ?

#1115836

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dmitry,

This can definitely be something that our development team can look into, however I doubt that it would make it for the next release.

However what you can do is to create a feature request ticket for this.

Thanks,
Shane

#1117830

I started use s2 Member (Free) for this. Works perfect.

#1117831

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.