Skip Navigation

[Resolved] I need to make a 3 levels relationships (Years/Makes/Models) for car moldings

This support ticket is created 6 years, 3 months ago. 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.

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 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1150076

Tell us what you are trying to do?
I tried to make a 3 levels relationsships with my woocommerce products.

First, customers have to select the year after the make and then choose a model.

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

#1150421

Hello,

In your case, I don't think using post type relationship is a good idea, for example
Years:2018 Makes: Ford ...
Years:2018 Makes: Audi ...
Years:2017 Makes: Ford ...
Years:2017 Makes: Audi ...

In this case, you can not setup one-to-many relationship between post type "Years" and "Makes", it needs many-to-many relationships, then it won't work as State-> City -> Property as our demo site:
hidden link

I suggest you try to with custom taxonomies, then use AJAX search setting "Show only available options for each input" in your custom search form.

For example:
1) Create three taxonomies, register them to post type "Product":
- Years
- Makes
- Models
https://toolset.com/documentation/user-guides/create-custom-taxonomies/

2) Then you will be able to edit each product posts, and assign terms with those three taxonomies easily.

3) Create a post with search form, query product posts, filter by those three taxonomies, in section "Custom Search Settings", enable option "Show only available options for each input", then in front-end, when user select Years "2018", the other two taxonomy fields ("Makes" and "Models") will display only available options, see our document:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/#dependent-parametric-search