No results
-
Hi,
I found on your site, that the plugin works great with SearchWP Live Ajax Search plugin. And even though I found Relevanssi to enrich results on my search results page, it doesn’t show live suggestions at all with Live Ajax Search. Since this other plugin doesn’t even have a settings page, I’m trying to figure out what my be the reason and how to solve it.The page I need help with: [log in to see the link]
-
Your site seems to be showing live suggestions now, so did you get it to work, or is that some other solution?
Generally, SearchWP Live Ajax Search just works. There are some issues with the default settings, for example, searching for attachments doesn’t work without changing the settings, because SearchWP Live Ajax Search looks for published posts. But that shouldn’t be a problem in a basic product search like this.
Since SearchWP Live Ajax Search is very much a javascript product, I’d check the browser javascript console to see if there are any errors there.
Sorry, I was still searching for a solution and changed the settings, so what you may have seen was the built in search, that doesn’t include results based on tags.
When I enable Relevanssi and proceed to a search result page, I can see the results based on tags, so that part works. But I see no live suggestions.
In the console I see no JavaScript executed when I type a search both when I have theme’s suggestions enabled and disabled. When it’s enabled though, I can see in ‘Network’ that ‘?wc-ajax=nm_shop_search’ is being requested, but fails.
As for now, I turned Relevanssi and SearchWP Live Ajax Search back on: https://dev.monds.pl/
Can it be your theme has a built-in AJAX search that’s overriding SearchWP Live Ajax Search? It should make a request to admin-ajax.php with the action
searchwp_live_search, and it’s just not firing on your site. Looks like all the assets are loading correctly, though.So I suppose I would start by looking at how to disable the existing AJAX search first – or perhaps looking if that can be modified to use Relevanssi. Some AJAX searches are hard-coded to use the basic WP_Query, but some have either a filter to modify the query parameters, in which case you can just set
relevanssitotrueto get Relevanssi results, or have a filter that let you change the querying function fromget_posts()to something else.That’s right – the theme has a built-in ajax search. I managed to turn it off by disabling ‘search suggestions’ in theme customization panel, and now there’s no ‘?wc-ajax=nm_shop_search’ request, but no results appear.
Hmm. I’d tell you to contact SearchWP Live Ajax Search support about this, but I know that’s of no use, the plugin seems to be floating pretty free now that SearchWP got bought…
I saw this on the SearchWP Live Ajax Search plugin page: “If you would like to manually enable SearchWP Live Ajax Search on a custom search form, simply add the following data attribute to the input you want to hook: data-swplive=”true”.”
Those data attributes are missing, so I guess the problem is that your theme prints out the search form in a way that SearchWP Live Ajax Search can’t automatically hijack. So perhaps try adding the data attribute manually?
Edited out
-
This reply was modified 4 years, 4 months ago by
mondipl.
Ok, so I managed to add the data attribute and I can see the suggestions now.
Would it be possible for them to include price and thumbnail? And is there an option to style them myself?
See “Customizing results” here: https://searchwp.com/extensions/live-search/
If you want a really custom look, you can create a custom template where you can display any information you want. You can also use CSS to style the results.
Thank you so much for your help, especially that it goes way beyond the scope of Relevanssi plugin!
If I may have just one more extracurricular question – do you think there is a way to make the live suggestions ‘printed’ inside the theme’s search bar/overlay somehow?
I’ve never done that, but it looks like you can change the parent element of the results element in
searchwp_live_search_configs, and I guess that’s how you’d approach that… but like I said, I’ve never done it, so I don’t know more.Great, I’ll look into that. Thank you again!
-
This reply was modified 4 years, 4 months ago by
The topic ‘No results’ is closed to new replies.