Skip Navigation

[Closed] Two custom searches merged into one …

This support ticket is created 2 years, 9 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/Karachi (GMT+05:00)

This topic contains 5 replies, has 3 voices.

Last updated by Waqar 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2277485

a.R

Hi.

To get better search results, we first want to display posts of the "BASICS"-category, and beneath that, seamlessly, posts OUTSIDE that category. (We move the results of the first search into the second search results by JQUERY.)

It works when loading the page, but there are 2 problems:

1. When changing the search criteria, we need to trigger that first search again. How do that? How trigger a search?

2. And then, as infinite scrolling happens, the first bunch of search results of the second search disappear. How prevent that?

THANK YOU 🙂

#2278219

Hello,

Are you using AJAX search forms for both post views?

If it is, there isn't such kind of built-in feature with AJAX search form, you might consider to disable AJAX search feature, submit the search form with a submit button, and pass the same URL parameter to both search forms, and test again

#2278911

a.R

Yes, it should work with AJAX.
How about:
1. Hide the search form of the BASICS search somewhere on the page
2. Transfer the clicks from the nonBASIC search form to BASICS search form through jquery

(Maybe it would be better then not to merge the search results, but to have them one after the other?)

#2279633

As I mentioned above: there isn't such kind of built-in feature with AJAX search form.

According to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/
You can also check it with our Toolset contractors:
https://toolset.com/contractors/

And you might consider the workaround I mentioned above:
disable AJAX search feature, submit the search form with a submit button, and pass the same URL parameter to both search forms

#2280593

a.R

So you don´t see at first glance, why my solution should not work?
So I´ll just try it... 🙂

#2281833

Hi,

Luo is on vacation this week, so I'll be following up on this ticket.

You're welcome to try your planned solution of using two separate search forms and keeping them in sync using a custom script.

In case, you need any assistance around Toolset's search hook and events, feel free to let me know, along with the link to the example page.

regards,
Waqar

The topic ‘[Closed] Two custom searches merged into one …’ is closed to new replies.