This support ticket is created Il y a 5 années et 2 mois. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
//// Tell us what you are trying to do?
I built a location map that will display the shop that are selling my products.
For this, I create a CPT but I get the address and all custom fields from a repeater field.
I this repeater, I have a checkbox that contains 3 types of products named "available-products"
I want to be able to filter the loop results with 3 buttons that are related to the checkbox field.
/// Is there any documentation that you are following?
For sure, I read all the doc about filter!
///Is there a similar example that we can see?
/// What is the link to your site? hidden link
The sample is on top as a graphic only, the view that I started is under the first map.
Thank you for contacting us and I'll be happy to assist.
Based on what you've shared, I understand that you have a CPT "Shop", and each shop can have multiple locations and you're using a repeatable field group, to store information about each shop's location.
If that is correct, it won't be possible to filter the view that shows the list of shops, based on a checkbox or any other type of custom field, that is part of a repeating field group. This is because, the way repeating field group field's data is saved, it is stored as a separate child posts and not with the actual parent post (which in your case is "Shop" CPT).
To make this work, you can create a new CPT "Shop Locations" and store each shop's location information, as an individual post in it. The custom fields for location and type of products offered will also be saved with this new CPT.
Thank you Waqar. But if I create a new CPT (shop locations), will it not be easier to use categories for my type of products to filter and still display on a map instead of wanting a One-to-Many relationship ?
Or maybe the product type are a CPT and a Shop locations too so I can make them in one-to-many relationship ?
Actually, I set up both and they work well, next level now.
Can I change the name of the filter terms at all ? If I want to add some extra juicy subtitle and make them as button ?
My idea is to use some custom field to insert into the terms. Thank you.
Well, I use CSS ::before to make it happen, not a client easy change to make.
I would still like to know if I can use meta terms custom field to spice up the text of category please.
Also my other concern is the reset button.
As you see, my filter is on top of the map, and I want the reset to be positioned below the map...
Maybe it's just easier than I can think.
Thank for all your awnsers and dedication!
When the "wpv-control-post-taxonomy" shortcode is used in the "Search and Pagination" section, it generates the list of taxonomy terms automatically. That output can be customized using the available attributes, as listed at: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-521572
In case you'd like to generate this list manually in an even more customized format, you can copy the output that shortcode generates, customize it and replace it with the "wpv-control-post-taxonomy" shortcode.
For example, currently the output for the taxonomy filter is:
To make sure that the reset button works correctly, it needs to be present in the "Search and Pagination" section. So if you'd like to show the map before this button, you can move the map's shortcode "[wpv-map-render]", in this "Search and Pagination" section, above the reset button.
For future reference, please note that as per our support policy ( https://toolset.com/toolset-support-policy/ ), only one question or issue can be addressed through a single ticket.
You're welcome to open a new ticket for each new question or concern.