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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: productOptions don't hold the correct order and change alphabetically after Product creation

productOptions don't hold the correct order and change alphabetically after Product creation

abishekrs
Shopify Partner
25 3 8

I am using the `productCreate` mutation for creating a product along with 2 productOptions and within each productOptions, I set the values in a specific order. But after I create the product, these productOptions get sorted by Alphabetically. 

 

Here is an example. Here is the productOptions I passed when I created the product

 

CleanShot 2024-08-20 at 16.59.59.png

 

But after creating the product, this is what I see on the Shopify Admin of the product and the product page

CleanShot 2024-08-20 at 17.01.38.png

 

CleanShot 2024-08-20 at 17.00.30.png

 

How do I go about fixing this? Otherwise I have to manually fix this for every product I create using the API.

Replies 2 (2)

Kyle_liu
Shopify Partner
441 55 80

Hi @abishekrs 

 

Currently, sorting is not possible in the productOptionCreate API.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
abishekrs
Shopify Partner
25 3 8

I am setting the productOptions on the `productCreate` mutation and not `productOptionCreate` mutation.
Is there a solution to this? Is there a way to update the productOptions with the correct order after the product is created?