All things Shopify and commerce
Hi,
I am developing an app for which I was trying to fetch the products and sort them on the basis of price, and created time. So I created a collection template and made the request to it. I named this 'templates/collection.test.liquid'.
{% layout none %}
{% capture productsJson %}
{% paginate collection.products by 25 %}
{{ collection.products | json }}
{% endpaginate %}
{% endcapture %}
{{ productsJson }}
Then to get products sorted by price descending I would make a fetch request from shop to this link
https://some-kind-of-example.myshopify.com/collections/all?view=test&sort_by=price-descending
and I will get the JSON data.
Now the problem is when app will be created I had to create this template for user. But I can't as it is not allowed.
Can I do the same thing with theme app extension ?
I have tried to get the liquid code in this way
{% assign allProducts = collection["all"].products %}
{% for product in allProducts %}
{{ product.title }}
{% endfor %}
but this code only fetches the first 50 products. And if try to sort them, it will just do the sorting in those products.
I need help regarding this.
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025