Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Currently, the way the default product catalogue is sorted is by A-Z.
I want to change the default sorting to the newest products first. AKA "'created-descending'"
I've tried editing a bit of code on the "main-collection-product-grid.liquid", specifically:
// tried changing the default in this code to a few different options.
{%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}
// Added the below code as well.
{% if collection.handle == "all" %}
{% assign sort_by = 'created-descending' %}
{% endif %}
Please advise how to change the default sorting of the main product catalogue
In the theme editor, navigate to the "Sections" folder and open the main-collection-product-grid.liquid file.
Look for the following code:
{%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}
Thanks for the reply Nomtech!
I have already messed with that code to no avail.
I'm sure it's the right line of code to change but I dont know what to change it to, in order to default it by product upload date.
I probably change this part, yea? "default: collection.default_sort_by"
To what?
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025