Add to cart from App Proxy

Add to cart from App Proxy

Conner_Pope
Shopify Partner
48 1 19

Hi there,

 

does anyone have experience with add to cart from the app proxy page?

 

Looking for help.

 

Thanks!

Reply 1 (1)

HunkyBill
Shopify Partner
4853 60 558

The ability to add to cart is one the first Javascript hacks Tobi ever released for Shopify. You can find many calls to /cart or /update to handle that. Why would that involve an App Proxy? An App Proxy is meant for you to securely call your App to get some Liquid or JSON.

 

So the simple answer for you is this. If you can successfully use an App Proxy to make a call like /tool/feeblefuzz?12345 and you get back JSON like { "variant_id": 43211234582626, "quantity": 2 } you could easily run the standard Javascript call to update or add to cart that variant.

 

So first things first. Add to cart using your JS. Once you mastered that, do your Proxy callback, and when you get back a variant ID and quantity, push it to the cart. So two calls. One result. App Proxy to update cart.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com