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?
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024