I have a product in that we are using as a source product to create custom products based on user input suggestions. Once created the user is redirected to the cart with the newly created product added to it.
However these dynamic products are showing as unavailable and as such I am unable to complete the checkout process.
I noticed that when creating these products and I view them in Shopify admin that they are not attached to a sales channel. Is there something I need to do in relation to that?
Here is how I am creating the product:
'product' => array( "title" => $product_title, "product_type" => "Cut To Size", "published"=> false, 'variant'=> array( 'price' => $product_price_per_item, 'fulfillment_service' => 'manual', 'inventory_management' => null, "inventory_quantity" => $quantity ) )
Any help would be greatly appreciated.
Solved! Go to the solution
This is an accepted solution.
You'll need to publish the product to that specific sales channel. Some pointers here: https://community.shopify.com/c/Shopify-APIs-SDKs/Sales-channel-visibility-via-API/m-p/657980/highli...
Let me know if you get stuck.
@SBD_ thank you for this. I only need the product to be available to the customer that created it. If I add this product to a sales channel will it be available to the customer while not being available to anyone else?
@SBD_ when a customer creates a product it automatically gets added to their cart. This product variant will just be for that customer as it will be for their specific requirements. Therefore we need them to be able to complete the checkout process with the product but we do not want this product being added to the shop catalog for other to see.
@garethrane on second thoughts, the draft order API might be better suited - it allows custom line items: