I want to use "_stock" for a filter on a search page. But when I chose a "Custom Search Filer", I can see a lot of custom fields, but not this one.
I used this documentation and it works fine except for the stock filter:
https://toolset.com/course-lesson/creating-a-custom-search/
You can find the other working filters beneath the map/radius search (WCFM):
hidden link
Hi,
Welcome to Toolset support. The _stock field is a protected custom field used internally by WooCommerce to manage product stock quantities. In WordPress, custom fields prefixed with an underscore (e.g., _stock) are considered hidden or protected. As a result, Toolset's interface does not display these fields in the list of available custom fields for filters.
To make this work on Toolset please do as follows:
https://toolset.com/course-lesson/using-third-party-hidden-fields/
Thanks.
Thanks, Christopher!
I followed the instructions, but "_stock" is still not visible, when I add a Custom Search Filter. Is there anything also to be done to use a protected custom field?
Regards,
Jens
Hi Jens,
If you go to Toolset > Custom Fields do you see the automatically generated field group "Toolset WooCommerce", which can view but not change, that includes many WC fields, including the stock quantity (_stock).
They should all be accessible in the UI for filters etc.
If you could not fins, I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.
Make sure you set the next reply as private.