Hi, I have a custom post which has a children posts (each one is used to save price variation of parent CPT). For example its like a given car model (as a parent CPT) and it´s variations (cheap, normal and premium version). And I would like to include the prices in Custom search which is primary built for parent CPT hidden link The search results show only one parent and if there is more than one variation, it shows the sign "from the lowest price xxx".
How can I do this?
Dear Dave,
There isn't such a built-in feature within Views plugin, Views is using Wodpress class WP_Query to query the posts in database, so when you are querying the posts of parent post type "parent-cpt", you can only filter the query by the custom fields of post type "parent-cpt", you can not filter the query by fields of child post type. It is a limitation of WordPress, so it is not possible within Views plugin.
More help:
https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
So what are my options? When I built my site, I tried to avoid using repeating fields. Even with the new beta plugins Many-to-many it wouldn´t be able to do this?
I don't think there is other better option within current version of Views plugin, if you agree, we can take it as a feature request, our developers will evaluate it.
Currently you can check it with our Toolset Contractors:
https://toolset.com/contractors/
So this feature will not be in next version of Views 2.3 Many-to-Many? If not please take that as a feature request.
No, I don't think there is such kind of feature within Views 2.3 Many-to-Many, and I have forward it to Beda, he manages the feature requests of Views plugin, our developers will evaluate it.
OK Luo, thank you for the information and forwarding to Beda and developers.