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 -%}