Skip Navigation

[Résolu] Child posts in Custom search

This support ticket is created Il y a 6 années et 11 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 6 réponses, a 2 voix.

Dernière mise à jour par toolset-dave Il y a 6 années et 11 mois.

Assisté par: Luo Yang.

Auteur
Publications
#598717

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 lien caché 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?

#598756

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

#598835

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?

#599119

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/

#599303

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.

#599703

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.

#599760

OK Luo, thank you for the information and forwarding to Beda and developers.