Re-sorting search results using the woocommerce "sort by" widget not working

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Re-sorting search results using the woocommerce "sort by" widget not working

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9679
    danielm777
    danielm777
    Participant

    Hi – a quick question: does this plugin support sorting by price?
    I found another support question on this subject from 2015 that had no reply…
    I chose the option to “Override the default WordPress search results with results from this search instance?” because I would like customers to see the same results on the search page as they do in the Ajax widget.
    However when I choose to reorder to search results by Price using the standard woocommerce widget the results are the same (re-ordering has no effect).
    Before I invest time in troubleshooting this myself I would like to know if sorting the results page by price is a supported operation. (from a quick glance with query monitor ASP fires the same queries regardless of the re-order choice).

    P.S. This behavior is the same for any of the Sort by options in the standard woocommerce widget – not just the price.
    Thanks,
    Daniel

    #9684
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Unfortunately that is not supported by adjusting an option, but possible with a custom code. Use this in the functions.php file in your active theme directory:

    Change the $asc variable in the code to false if you want to sort by price in descending order.

    The sorting issue with the other plugin might be unrelated though. Ajax search pro does not affect the layout of the items on the results page, it only tells the core which items to get, but no data manipulation is done there.
    Only possible issue I can think of is that you may need to change the Redirect to url? option to “?s={phrase}&post_type=product” on the General Options -> Behavior panel to get the correct redirection: https://i.imgur.com/fB5lrSE.png

    I hope this helps!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.