Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi I am using
/admin/api/2021-04/smart_collections/{smart_collection_id}/order.json?products[]=921728736&products[]=632910392
This api to update my order of products manually.
This is working and on my shopify store it changes the order correctly.
But after the order is changed. I should get the products in sorted order using this api.
GET /admin/api/2021-04/products.json?collection_id=841564295
But I am not receiving products in the same order as they are on shopify store. It does not have position attribute as well.
So what i want is that i should get products in the same order in which products are appearing in my store.
Solved! Go to the solution
This is an accepted solution.
Hi Urmir
You have to specify the order of your fetching. Seems that in your case you should use the "manual" sorting. Here is more detail for the REST API you are using.
Link (sort_order)
This is an accepted solution.
Hi Urmir
You have to specify the order of your fetching. Seems that in your case you should use the "manual" sorting. Here is more detail for the REST API you are using.
Link (sort_order)
Thanks it worked. I was using product.json and passing collection_id to it.
But if we call collections/collection_id/products.json this gives us the sorted products
Is there a graphql solution to this problem??
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024