Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shopify API: Create hidden product variant

Tags:

shopify

Is it possible to create an unpublished/hidden product variant through the Shopify API? I know it's possible to create a hidden product by specifying product['published'] = false in the POST request, but I just want to create a hidden variant that can be added to a cart.

What I'm attempting to do is create a "sale" item that's only available to a single user with a specific cart. I can create the product variant through node.js, and I can use AJAX to actually add the product to the cart on the client side, but I'll never have access to the shop's dashboard so I can't mask product variants through collections, linked options, et cetera.

Any help is greatly appreciated!

like image 218
stephenkao Avatar asked Oct 22 '22 19:10

stephenkao


1 Answers

It’s not possible to hide a particular variant at the API level, but you can do it via Liquid or client-side code.

Take a look at how http://apps.shopify.com/quantity-breaks implements this and you should have a better idea.

like image 153
Edward Ocampo-Gooding Avatar answered Jan 02 '23 21:01

Edward Ocampo-Gooding