简体   繁体   中英

Shopify API: Adding an item to cart without redirect

Is there any way to submit an add to cart POST request without any sort of page redirection whatsoever? Changing return_to to "back" reloads the page, which I don't want to do. I want to add the item to the cart and use a jQuery notification to alert the client, without any type of redirection/reloading. The notification part works fine, I just can't figure out how to override the redirect. Sorry if some of the things I said make no sense, I'm new to this stuff. Thanks in advance.

You can use the AJAX API. Details are here: http://wiki.shopify.com/Ajax_API Check out the Shopify.addItem function in the jQuery wrapper demo page: http://mayert-douglas4935.myshopify.com/pages/api

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM