Skip Navigation

[Resolved] filtering by custom fields checkboxs as follow-up to previous Q

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 7 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#488782
image-1.PNG

I have a multi-taxonomy filter working fine on a View, and am trying to add an additional custom field filter based upon if query has the checkbox checked based upon 'current' page of loop. Your previous answer to an unresolved question implied that if I move our Product List from a taxonomy to a custom field, toolset would be better able to perform w/o custom coding. I don't know how to set this filter. I moved our Product List (names of products) to Custom Fields so that multiple checkboxs can be checked per Supplier based upon what products the supplier sells. Now in the View, I need to filter the Supplier Details Post Types to those that checkboxs at least match that of 'current page' in the loop. Note 'current page' name is the product list names. And, this 2nd filter is drawing from the same Supplier Details Post Type as the 1st multi-taxonomy filters.

#488811

Hi,

Could you describe more details for the question:
add an additional custom field filter based upon if query has the checkbox checked based upon 'current' page of loop.

How do you create the custom field? with Types plugin? is it a custom checkbox field?
How do you setup the view? where do you put the view ?
I need detail steps to duplicate same problem, thanks

#491046

I have a 'Suppliers Details' Post Type (names of companies selling products) setup w/ Toolset. It dislays a Custom Field created with Types called 'SUP Products Identify' (a collection of all products a supplier sells). Within it I have one Field called 'SUP Products' (a list of products that supplier sells). It uses the 'checkboxs' option and has 100 different checkboxs/Field Names (names of products).

I also have a 'Product Ad' Post Type (displays info on that product) that uses a Content Template both created with Toolset. Within that Content Template is a Toolset View that uses the 'Supplier Details' as its Content Selection. That View filters by specific Taxonomies each created w/ Toolset and that works fine.

The problem is that I also need to provide a conditional output to the Loop (instead of another filter). I'm not sure how to write this condition. I need to display only the suppliers that sell that particular product, whereas the product is identified by the page that the Loop is displaying on.

Such that, the condition needs to limit/display the 'Supplier Details' Loop item, if its 'SUP Products' checkboxs [with matching Field Name as the current page the Loop is displaying on] is checked on. Nigel had been helping me.

#491071

Thanks for the details,
1) I don't think it is a good idea to setup 100 different options in one custom checkboxes field, it will conduct some performance problem and other problems, I suggest you setup a custom Hierarchical taxonomy "SUP Products" to replace it, see our document:
https://toolset.com/documentation/user-guides/create-custom-taxonomies/
You can register the taxonomy "SUP Products" to both post types: 'Suppliers Details' and 'Product Ad'
Then it will be able to construct many-to-many relationship between post types 'Suppliers Details' and 'Product Ad'

2) if you setup the taxonomy "SUP Products" as I mentioned above, you will be able to setup the taxonomy filter within Views:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
Value set by the current page where this View is shown
The View is always inserted somewhere. That page where the View is inserted is responsible for setting the taxonomy term. This is good when you want the same View to return different results, according to the page it’s inserted to.

The forum ‘Types Community Support’ is closed to new topics and replies.

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