Skip Navigation

[Resolved] paramatric search on product category page

This support ticket is created 6 years, 11 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Beda 6 years, 10 months ago.

Assisted by: Beda.

Author
Posts
#612176

Hi There Support Team

Can i get some tips....

What I want to accomplish is to show DIFFERENT paramatic search fields PER PRODUCT CATEGORY

Example:
Product Categorie 1. I would like to show fields A, B and C
and Categorie 2 I want to show fields B , D and E

How can I accomplish this??

Is it possible to use conditional output within a WordPress Archive?
I tried this and it does not work....

Can you help me further? Any suggestions?

#612371
Bildschirmfoto 2018-02-03 um 09.06.24.png

WordPress archives are assigned by WordPress itself, so this means an archive for taxonomies will be applied for all taxonomies, unless specified differently.

Toolset Views allows you this to some extent.
You can control each archive for each taxonomy separately.
But, you can not create Taxonomy Term archives, means an archive for different Terms.

With the WordPress API this is possible:
https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/

You can create a template that is called taxonomy-{taxonomy}-{term}.php (replace the placeholders with your terms).
This will call this specific archive when taxonomy/term "xy" is called.

That template needs to be created with PHP, but in it you could call a Custom Search crafted with Toolset Views.
https://toolset.com/documentation/programmer-reference/views-api/#render_view

This is although not what we intend to do with Toolset, we document it only to the "Taxonomy" level.

Now, you could theoretically also listen to the current archive within some Custom ShortCode and use that, to conditionally hide or show entire HTML chunks of your custom search (using HTML conditional).

But I do not recommend this, as it might produce unexpected search results when certain handles are hidden.

On the hand, you can as well use Toolset Views settings - eventually they help to achieve the goal.
In the Archives (or Views), you have the Custom Search Settings, where you can choose what to display of a search, depending on what you already searched for.

So for example, if a certain search A) does return a set of results that has no field "xy" saved, the Search for that field will not be shown in the View. (see screenshot)

These are the possibilities you have with Toolset, please let me know if you need more help with it!

#612748

YES !! Thank you for the comprehensive explantation !!
I believe i understand it totally! =)

One more question though....

How would be the best way to hide labels of fields that do not show up ....

#613273

How would be the best way to hide labels of fields that do not show up ....

This would be the topic of a new Ticket, which I suggest you open if this Document is not clear:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

You may assign me to your new ticket if you wish.

#613316

Thank you Beda. I opened a new ticket but I don't know how to assign you to it..

#613386

I took it.