Skip Navigation

[Resolved] Exclude Products from View if WooCommerce Catalog visibility is set to hidden

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

Problem:
Exclude Products from View if WooCommerce Catalog visibility is set to hidden - Filter product by Catalog/product visibility

Solution:
To filter the product by Catalog visibility equal to hidden, You should navigate to "Query Filter" section of your view and try to add a taxonomy filter for the taxonomy "Product visibility" there you should select the two options "exclude-from-catalog" And "exclude-from-search" and also make sure you select the option "All of the following".

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/exclude-products-from-view-if-woocommerce-catalog-visibility-is-set-to-hidden/#post-1871479

Relevant Documentation:
- https://toolset.com/documentation/user-guides/views/filtering-views-by-taxonomy/

0% of people find this useful.

This support ticket is created 3 years, 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by scottL-3 3 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1869525

Tell us what you are trying to do?
Using WooCommerce Views to show Views of Products and need to exclude hidden products based on the WooCommerce Catalog visibility setting of hidden.

Wondering if there is a way to do this with Toolset without needing custom code to filter the query args (I have several views where this needs to work and don't want to have to remember to add view ids to the filter anytime I create a new view in the future).

I'd really like to have WooCommerce Product Visibility available in the filter options for the View.

Is there any documentation that you are following?
Not really. I don't see anything in the documentation or Views filter options that appears to honor the visibility setting for a product.
Is there a similar example that we can see?

What is the link to your site?
hidden link but there's nothing to see there.

You can see what I'm trying to accomplish on any WooCommerce site by changing a product's WooCommerce catalog visibility to hidden then using a View to list products from a category that product is in. The product will show.

We are creating some grouped products where we don't want the underlying linked products to show in our Views for categories and custom taxonomies so the customer can simply find the grouped products and choose quantities of the linked products from those without having to decide whether to click the grouped product or one of several linked products from the View.

#1869731

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please navigate to:
Toolset => Settings => Front-end Content tab => Hidden custom fields section => Click on button "Select custom fields" and try to find and checkmark the checkbox option with "_visibility" and "Apply" the settings.

Then Edit your view and navigate to "Query Filter" section and click on button "Add a filter" and add the filter for the "_visibility" and set its value to "hidden".

I hope the above solution shared with you will help you to resolve your issue.

#1870621

Hi Minesh, _visibility isn't in the list of hidden fields I can check when I go to Toolset -> Settings -> Front-End Content -> Select Hidden Fields.

I think WooCommerce stores this value in the serialized attributes postmeta as is_visible:
a:1:{s:4:"size";a:6:{s:4:"name";s:4:"Size";s:5:"value";s:68:"Cube 4x4x4 inch | Regulation 9x5x5 inch | Jumbo Standard 10x7x4 inch";s:8:"position";i:0;s:10:"is_visible";i:1;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:0;}}

So it is not something that we can easily use in a query filter, correct?

I suppose I could add my own separate field to use but then I'm back to the problem of having to apply it in not just all my views but also all standard WooCommerce archives that I wouldn't otherwise need to modify unless I remember to check my box AND set the item to hidden in the WooCommerce visibility setting. I worry about training the customer to create and edit their products properly with that much complexity.

#1871479

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I think WooCommerce stores this value in the serialized attributes postmeta as is_visible:
a:1:{s:4:"size";a:6:{s:4:"name";s:4:"Size";s:5:"value";s:68:"Cube 4x4x4 inch | Regulation 9x5x5 inch | Jumbo Standard 10x7x4 inch";s:8:"position";i:0;s:10:"is_visible";i:1;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:0;}}

So it is not something that we can easily use in a query filter, correct?
==>
Yes - obviously thats correct, you can not set filter for the content that is stored in database as serialized array. So, thats not an option at all.

However - I've found another way.

What if you edit your view and navigate to "Query Filter" section and try to add a taxonomy filter for the taxononmy "Product visibility" there you should select the two options "exclude-from-catalog" And "exclude-from-search" and also make sure you select the option "All of the following" as per the following screenshot.
=> hidden link

I hope this will help you to fix your issue.

#1871849

That did it! I never thought to look in taxonomy filters as WooCommerce puts the visibility setting in the Publish settings area of the Product editing page, not down with the other taxonomies.

Thanks for finding and pointing out where Product Visibility can be used as a filter.

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