Support » Plugin: Ajax Search for WooCommerce » Change search results order priority?

  • Resolved inlorfaze

    (@inlorfaze)


    Is there any way to change the order for product search results?

    For example, searching for “Oatmeal” prioritizes searching by the title, and then the tag. “Oatmeal” is a more specific tag for products but we also have “Oatmeal soap”, which shows up first. Since tags are more specific, can we make the search prioritize tags first so products with tag “Oatmeal” show up before products containing “Oatmeal” in the title?

Viewing 1 replies (of 1 total)
  • Plugin Author Damian Gora

    (@damian-gora)

    Hi,
    You can’t do this via plugin settings. I plan to add a custom order. You will be able to change the order of the search results manually for each query. This feature will be implemented in the 1st quarter of 2020.

    Also, if you want to change ordering only for few serach results, it’s possible to do it manually in the PHP code. If you are interested in, upgrade to the Pro version. I can write PHP snippet as part of Premium support.

    If you want to stay with a free version and you are familiar with PHP, you can try to reorder it using the following filter:

    
    add_filter('dgwt/wcas/search_results/output', function($output){
        // Get query from $_POST
        // Write own order rules
        return $output;
    });
    

    Best
    Damian Góra

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.