Custom default sort for different searches

  • pseudo visitor
    Participant
    # 1 month ago

    I have a WooCommerce site, and want to use different default sorts, for the search and shop results.

    wpsolr
    Keymaster
    # 1 month ago

    It is possible using our WP filter https://www.wpsolr.com/guide/actions-and-filters/search-results-default-sort/

    The idea is to use the WPSOLR filter above, and compare the current url to the two target urls (blog search and product search) to return the specific default sort (by relevancy or product price for instance).

    You do not need to show a sort listbox if you don’t want to. The correct default search will be applied in the background search query, and the results accordingly sorted.

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

You must be logged in to reply to this topic.