Hello, I want to change default sort by value, from “Alphabetically, A-Z” to → “Date, new to old”
This is the page https://kartbagrationvalley.com/collections/all
Regards,
Hello, I want to change default sort by value, from “Alphabetically, A-Z” to → “Date, new to old”
This is the page https://kartbagrationvalley.com/collections/all
Regards,
Change the sort order of the collection itself is the simplest approach
I’m asking different question Paul, I know how to change sort order in “COLLECTIONS”, I don’t want that.
I’m asking to change sort orders on Products page. or T-shirts tab or Hoodies tab.
Default sorting value is sort alphabetically but I want to sort with date of creation. I know that I have to change some code but I’m unable to find it
https://xyproblem.info/ ahead,
If you want to change the sequence/order of how sorting options are PRESENTED as UI,
Most themes autogenerate the list so you have to make it manually with html/js as an advanced theme customization.
Copy out the existing html source (ctrl+u) , change the order of the elements in the html source code being copied and replace the template logic with that; the logic may or may not be similar to the reference implementation:
With “Alphabetically, A-Z” still being the default_sort_by because that is collection datas default itself even if you force the UI to display something different.
If when a customer visits a frontend page you want to force products in a collections URL to be sorted in a specific way, regardless of the options chosen or instead of the actual default set in the collection admin , then it’s advanced workarounds with the sort_by url parameter and redirects using javascript or meta directives, etc . See the parameters in the .dev docs or by navigating on the frontend with the sorting options to see the different url parameters.
Otherwise just use the collection-admin, or automations, to properly sort products in the first place.