Draft order converted to a checkout

Solved
Shopify Partner
3 1 0

I've looked in the forums, but not found something to help.

 

I want to add custom items to the cart when the user is checking out, based on the contents of the cart. I've got the code to create the draft order, because the extra items can be variable costs, but how do I get the user to checkout with this draft order, instead of the cart? not sure I'm making sense here.

 

I've seen apps like Hulk discount, and the Hulk custom product options do this, how's it done?

 

Dave

0 Likes
Highlighted

Success.

Shopify Expert
9542 28 1310

In general, the apps that use a Draft Order checkout hijack the cart "go to checkout" button click with JavaScript.

On button click they send data to their app, the app creates the Draft Order, the app sends back the new url to the page. The customer is then redirected to the Draft Order url. API limits are something you need to consider if all your checkouts will be created in this way. Also be mindful that discounts are not supported on Draft Order checkouts so the field shown will only accept gift cards.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes