Skip Navigation

[Resolved] search relation ship

This support ticket is created 4 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 2 voices.

Last updated by Christian Cox 4 years ago.

Assisted by: Christian Cox.

Author
Posts
#1560137

when i build the search i need it also filter the field content so its depend on other search field.

For example, we have categories, brands, and models.

So if a user selects some category i need to show the brand of this category and if he selects a brand i need to show the brand models only.

How can i do that?

#1560453

Hello, Views offers a feature "Show only available options for each input" that can be used to update the filter options as the User makes selections. You can see more about this feature here: https://toolset.com/documentation/user-guides/views/front-page-filters/advanced-settings-custom-search/#dependent-parametric-search

Let me know if this feature will solve the problem for you.

#1561361

hi, tnx for your respond ,
i read and view the video.
what is missing to me is how to make the relationship between the brands and the models.
in my case i added a brand field to the products type and then we addded the products with category,brand, and model(its the tags)

if you can give me guide and links from the start of the process i will be glad 🙂

tnx
nir

#1561857

The relationship between brand and model is based on the Products you create, and the selections you make for brand and model in each Product. In the dependent filters approach, there is no relationship between the brand and model other than the Products.

#1563587
Screenshot_2.jpg
Screenshot_1.jpg

tnx for the replay,
i understanf that the products him self is what create the relationship between the product-brands-models (tags)
my question is, can i mage a search that will show me the models for each brand in the filter or i need to create contents type for brand and models and then make a relationships between them ?

i attach image to show my case,
if i can do it like this, what is the right way to do it ?

#1564403

my question is, can i mage a search that will show me the models for each brand in the filter...?
Okay I understand your question now, thank you. Views allows you to create custom searches for posts, but not taxonomy terms. Unfortunately it is not possible to create front-end filters for a taxonomy term search. However, you could create a custom search for Products filtered by Brand. In the results of this View, you could output the Model taxonomy terms instead of the matching Product. This may display duplicate Model terms, but I can show you how to work around this problem with another View filtered by term ID.

...or i need to create contents type for brand and models and then make a relationships between them?
This is also an option. There is one limitation in Views you should be aware of when you make this decision. In a custom search View, you can add as many taxonomy filters as you would like. However, there is a limit to the number of post relationship filters you can add. You can only add one post relationship filter in a custom search View. The only exception is when you have multiple one-to-many relationships chained together. In this case, you can add multiple ancestor filters.

If you would like to collaborate on a solution, I can set up a demonstration in our sandbox site. Have you signed up for a free account at https://discover-wp.com ? If so, I can add you to a project and begin working together.

#1564685

hi,
i have an account on discover-wp
i also open a test site
hidden link

i also can give you access to the dev site that i build.
if you have paid support that somebody will teach me online what to do just say 🙂

i tried on of the contractors of your but they don't want to teach, they want to do...

#1564883

Okay I have invited you to my sandbox site, can you check your email?

I put together a small example showing how you can use a complex system of nested Views to achieve something like what you have described:
hidden link

In this setup, there is a View of Products filtered by Brand:
hidden link
This View is visible on the left side of the page, so you can see the filtered Products and their associated Brands and Tags (models). This View has front-end filtering by Brands. You'll notice that the same filter and URL parameters also are applied to the View "Model IDs from Product Contexts filtered by Brand". Nested inside this View is a View of the Models taxonomy filtered by term, set by the current post. This produces a list of Model term IDs, which can then be used to generate a list of Model terms:

hidden link

So effectively we have produced a list of Models, filtered by Brand, even though a parametric search for terms is not achievable in the current system. My day is closing here and I am off on Fridays, but I will return Sunday to continue our discussion.

#1566503

tnx,
i enter the site and see the states - town - district
but i don't see the search in the frontend

i also don't see a search view.

please advise when you can 🙂
tnx

#1566751

hi,
managed with the brands and models but now i have another problem.
hope you can help me 🙂
we have some generic products that can match couple of models and each model have separate cable.
so we have a variable that the client can select his cable by the model.
but, if the client all ready to search the brand and the model so we know his model, is it possible to pre-define the variable after the search to the right cable?

i hope i explain my self ok 🙂

tnx
nir

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/predefined-search-parameter/

#1568249

I don't really understand but it sounds like a separate issue, so I have split it into another ticket. Let's follow up there and continue the discussion.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.