Re: Can I delete more than 1,000 variants with the productVariantsBulkDelete mutation?

Can I delete more than 1,000 variants with the productVariantsBulkDelete mutation?

jam_chan
Shopify Partner
909 23 184

When the variant limit is increased to 2,000, can I delete more than 1,000 variants at once? From the productVariantsBulkDelete mutation, I can't see if the operation is OK.

 

I want to remove the existing variants and only keep the 1st one. How can I do so?

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
Replies 4 (4)

AsafGitai
Shopify Staff
48 8 11

HI @jam_chan 


productVariantsBulk* are currently meant to support up to 250 variants.

I want to remove the existing variants and only keep the 1st one. 
It sounds like you want to delete the options as well, you can call productOptionsDelete with strategy Position.
Alternatively you can call ProductSet with the options and values you would like to have for the product

jam_chan
Shopify Partner
909 23 184

Thanks for your prompt reply. If I want to delete all existing variants, then I have to run 8 productVariantsBulkDelete mutation? Can Shopify improve this mutation to delete more variants?

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
AsafGitai
Shopify Staff
48 8 11

If you delete all the options via productOptionsDelete  or call ProductSet with [] on options & variants - it will return the product to have the default variant. 
There is not product without a variant

jam_chan
Shopify Partner
909 23 184

Thanks @AsafGitai 

 

Can I delete all variants except the default one and keep the 2 existing options? I try to run the productOptionUpdate mutation without success.

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview