Liquid, JavaScript, themes, sales channels
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?
User | RANK |
---|---|
37 | |
29 | |
13 | |
12 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023