Created
October 9, 2019 20:56
-
-
Save pauloharaujos/c6c99b3c7f158ba10b114a8808e200da to your computer and use it in GitHub Desktop.
M1 - Add product to cart using AJAX on PDP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ($('product_addtocart_form')) { | |
| var data = $('product_addtocart_form').serialize(); | |
| data += '&isAjax=1'; | |
| var urlAddToCart = $('product_addtocart_form').action; | |
| new Ajax.Request(urlAddToCart,{ | |
| method: 'POST', | |
| async: false, | |
| parameters: data, | |
| onSuccess: function (response) { | |
| console.log("CALL PAYPAL EXPRESS"); | |
| callShortcutPopup(); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment