skip to Main Content

Ajax POST request to Shopify's /cart/add.js always returning on error callback function

$.ajax({ type: 'POST', url: '/cart/add.js', data: { quantity: 1, id: form_data }, success: function(response) { console.log('in success'); var url = $("#af-btn").attr("href"); window.location.href = $("#af-btn").attr("href"); }, error: function(response) { console.log(response + "in error"); var url = $("#af-btn").attr("href"); //window.location.href = $("#af-btn").attr("href"); },…

VIEW QUESTION
Back To Top
Search