Behaviour when grouping results

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

 
Participant
7 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3437

    Participant

    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

    #3441

    Hi!

    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 :)


    #3449

    Participant

    Hi 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,
    Bastien

    #3454

    Participant

    Hi,

    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

    #3457

    Okays. 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 :)


    #3458

    Participant

    Hi 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.
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.