Is there any way to get ALL products in a collection through liquid rather than just the first 50?

Is there any way to get ALL products in a collection through liquid rather than just the first 50?

RConnolly
Shopify Partner
2 0 0

We need to find a way to access all products in a collection, however, at the moment, only the first 50 are available.

Once we have a Shopify object with all the products, we would like to filter out ones containing a specific tag, then pass the new filtered object to the Paginate object to be correctly displayed. 

 

At the moment, we are hiding the products containing that tag, but this has the side-effect of some pages in the pagination showing no products, because Paginate does not know about us hiding the products. So, it would make more sense for us to be able to provide a filtred list of products to Paginate, so that it would function as expected.

Replies 2 (2)

KuldeepKumar20
Shopify Partner
298 34 65

Hi you can get using ajax through this URL-- 
https://www.domain.com/collections/collection-name/products.json?limit=150

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: [email protected]
RConnolly
Shopify Partner
2 0 0

Thanks for the suggestion, is there any way that the response could be converted into a Shopify object after I filter out the products I don't want to display? If so I could pass that object to Paginate and use the out-of-the-box mechanism for displaying the products, which would cut down on dev time.