Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Trying To Sort A Collections Products With The Api

Trying To Sort A Collections Products With The Api

lramhudda
Shopify Partner
10 1 4

using the php api i am trying to get a product collections products in the manual order that is set via shopify rest api.

But... The api only returns the products in alphabetical order, which is not what I want, can someone help me out with this and let me know what variables i need in my api call to achieve this?

I want to sort order below sort key sort_order

alpha-asc: Alphabetically, in ascending order (A - Z). alpha-desc: Alphabetically, in descending order (Z - A). best-selling: By best-selling products. created: By date created, in ascending order (oldest - newest). created-desc: By date created, in descending order (newest - oldest). manual: In the order set manually by the shop owner. price-asc: By price, in ascending order (lowest - highest). price-desc: By price, in descending order (highest - lowest).


There is given exmaple to sort order but i dont know to use this in rest api https://shopify.dev/api/admin-rest/2021-10/resources/collection#resource-object

Please me if any one know about it thanks to advance to help me

 

Reply 1 (1)

liquidate12
Shopify Partner
7 0 0

did you ever find the solution to this? having same difficulty of using sort_order to sort fetched collection products