How can I alter the order of search results in Shopify development?

How can I alter the order of search results in Shopify development?

royal55flush
Shopify Partner
1 0 0

Hi, I'm new to shopify development and would like to make some changes to search result order prior to it being rendered.

 

I saw that on first page load the results are rendered on server and sent as html, and then on subsequent changes to the search (such as changing the sort by) there is an async fetch that responds with the new results re-rendered as html.

 

How can I shim into the search results for both of those instances? I'm not looking to change which items are displayed during a search, just which order the same items on a page are displayed.

 

At my current understanding, it seems like I would need to make some liquid code to re-order the results to my liking. Where do I implement the code? I wasn't able to find how this works in the docs.

Replies 0 (0)