Oct 5
Logic based custom fields
Is there a way for Custom Fields to only show if they apply to a specific main category or if other custom fields are selected? Some backend logic. If this, than show that.
Example setup:
- My main categories: "Pets" > Sub category "Dog" > Sub category "Dog Products" that included another sub category of "Dog Food" (but I have Apparel, Supplies, Toys and more as other options)
- My custom field could have a range of clothing sizes to materials, to organic and certified foods. It could be many custom fields that only apply to certain categories.
- Back to the example: Once a user gets down into the sub category for Dog Food, that side bar shouldn't show Apparel Sizes or Materials. Pull back a bit more, it should definitely not show fields that might only apply to Bird Food.
- Current behavior: All custom fields will be seen no matter what a user selects or filter out.
Potential backend solution: Could you optionally assign custom fields to category types in the backend? If you look at Shopify, they have Category Metafields. When you setup a product listing, you select a category to populate taxes but also meta data. Category selection is optional here but highly suggested. In my attached images you can see an example for Pet Apparel and then one for Doy Toys. You can see some of the preselected fields that Shopify has assigned to the category and then some custom field suggestions too. I'm wondering if something like this could work.
Completed
You can now achieve this with https://get-listable.com/docs/listing-types & https://get-listable.com/docs/blocks/item-list#filters