Can I use the Shopify Product API in my custom theme without creating a custom app?

Solved
New Member
2 0 0

Hi,

I recently noticed my shop page is limited to 50 products.

Upon further research, I discovered this is intended behaviour..

Some people have suggested using Shopify's admin API to overcome this.

I don't expect my store to ever have over 100 products live at a time

This is how I currently get all my products

{% for product in collections.all.products %}{% endfor %} 

 

If I were to use the Shopify API, could I possibly just replace that code with a call to the API or are drastic changes needed i.e. the development of a Shopify app?

I really don't want to have to make massive changes. My current shop page displays about 8 products at a time, and displays more when a "load more" button it clicked.

Looking forward to your suggestions and thanks in advance.

 

0 Likes
Shopify Expert
4320 35 445

This is an accepted solution.

First off, you do not use the Shopify Admin API like that for a shop! NONO! If you want to play with products on the front end, stay in the world of LIQUID!!

So your problem is listing all the products in your shop? And you're finding this loop of collections.all.products to be the problem?

You know there are a lot of techniques to display many products? We have infinite scroll, pagination, among others. Simple tutorials too. Have you tried this basic one?

    Show more than N products 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
New Member
2 0 0

Hi,

It was actually a very easy fix.

I wrapped the liquid for-loop code that loops through all products with the paginate code below.

{% paginate collection.products by 200 %}
{% endpaginate %}

 

After doing this, I was able to surpass the 50-product limit.

Thanks for your help.

0 Likes