Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Behaviour when grouping results
This topic contains 5 replies, has 2 voices, and was last updated by Bastien 9 years, 3 months ago.
- AuthorPosts
- January 12, 2015 at 9:21 pm #3437
Hi,
I am using Ajax Search Pro for my main search on a woocommerce website.
It works but I wanted to be able to group results to give a better results rendition to the visitor. For example, if I type the request WORD which is a brand and also correspond to some products:
– If I don’t group, I have 4 results, one for the brand, 3 for the products.
– If I group by categories, I have none.
– If I group by products, I have 3 results.I want to have the 4 results displayed in 2 groups separated by a line or somhething else:
– one with Brand
– an other one with all the products where this brand is presented.Thanks for your help et and your work on this plugin
Bastien
January 13, 2015 at 9:25 am #3441Hi!
Is the Brand a custom post type, or is it a taxonomy term or something else?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 13, 2015 at 1:34 pm #3449Hi Ernest,
Brand is an attribute of products in woocommerce.
If I don’t group, I can see the attribute “Brand” as the first result between four.
If I group, as it’s not a category nor a product nor a post type, it disappears.
I don’t if there is a way to post filter the results. I saw an example with the categories titles in the results titles with the hook asp_pagepost_results.
I thoughabout a solution with a hook: parsing the results and hash the url of the link of each result in order to add a line of the type of results when I see different groups (categories, attributes, products, …).
Thanks for your reply.
Have a nice day,
BastienJanuary 13, 2015 at 7:04 pm #3454Hi,
Just to add something. I saw that Brand is considered as a taxonomy by the faceted search plugin I have on my website.
Thanks for your help.
Bastien
January 14, 2015 at 5:55 pm #3457Okays. That might explain it. Grouping is for now only possible by Category or Post type but not by taxonomy. The search is trying to retrieve a category name for a taxonomy which probably results in a fatal error.
The category and taxonomy search is a fairly new feature so I’m working on some additional things regarding them. I’m going to add your request to the TODO list right now. I’m almost done with the next major update (which contains mostly compatibility updates), but I guess I can work out something, since grouping needs an update anyways. I can’t promise it’s going to be exactly how you imagined, but I will add as much flexibility as possible 😉
Will contact you in a few days with an update on this.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 14, 2015 at 6:13 pm #3458Hi Ernest,
Thanks a lot for your reply. I totally understand your problematic to select what to include in your todo list. It’s very nice to take my needs into account.
I join a fake screenshot of what I have in mind. You will see the categories and products separators in dark red. It’s like some other ecommerce searches, to show the results by type: products, categories, …
A last question: does Ajax Search Pro have some hook that I can catch with javascript with for example: $(document).on(‘asp-resultsloaded’, function() { … });
I ask because I use another plugin for faceted search which provide 2 hooks available in javascript, for refresh start and when facets have been loaded. It’s really useful to interact with the facets or the results direcly via jquery.
In my case, hooks usable in JS could solve my problem, even if it’s not the best way for performances (regenerate the results ordering).
Thanks
Have a nice day,Bastien
Attachments:
You must be logged in to view attached files. - AuthorPosts
You must be logged in to reply to this topic.