What's your biggest current challenge? Have your say in Community Polls along the right column.

Need to get First 1000 Items from shopify In a few words summarize what you're posting about at a hi

Need to get First 1000 Items from shopify In a few words summarize what you're posting about at a hi

SPBolton
Shopify Partner
1 0 0

I am trying to create xml feed Liquid code to get 1000 products from shopify but not able to sort by date. Every time i run code, its getting last 1000 products. I have 5K products on my shopify.

 

If I tried sort first but then it shows the error on paginate code because paginate only accept original array collections.all.products.

 

How to get newly listed product first?

 

My code - 

 

{% paginate collections.all.products by 1000 %}
 {%- assign collection_products = collections.all.products | sort: 'created-descending' | reverse -%}
  {%- for product in collection_products -%}

  ......rest of the codee.....

  {%-endfor -%}
 {%- endif -%}
{%- endfor -%}

 

 

Replies 0 (0)