All things Shopify and commerce
I want to get the product sort collection product best-selling, price-descending and price_ascending usign custom code.
{% assign productsnow = collection.products | sort: "best-selling" %}
{% for product in productsnow limit: 4 %}
{{product .title}}
{% endfor %}
{% assign expensiveproduct = collection.products | sort: 'price-descending' %}
{% for product in expensiveproduct limit: 4 %}
{{product .title}}
{% endfor %}
{% assign productascending = collection.products | sort: "price-ascending" %}
{% for product in productascending limit: 4 %}
{{product .title}}
{% endfor %}
Could you please let me know the issue how to fix this.
Shopify already has this based on their AI
"Sort by best selling"
Yes, I agree that shopify already has this based on their AI "Sort by best selling" . But we need to achive this using custom code. We need to built some custom feature.
User | RANK |
---|---|
38 | |
22 | |
21 | |
19 | |
17 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023