-
Hi guys,
Just got this note from Recharge for Shopify:
2. If you want to keep the cart – The function that would need to be added is the one as follows:
doAjaxAddToCart: function(n, r, a, p, amt) {
e.ajax({
type: “post”,
url: “/cart/add.js”,
data: “quantity=” + r + “&id=” + n,
dataType: “json”,
beforeSend: function() {
t.showLoading()
},
success: function(n) {
t.hideLoading();
t.showModal(“.ajax-success-modal”);
e(“.ajax-success-modal”).find(“.ajax-product-image”).attr(“src”, a);
e(“.ajax-success-modal”).find(“.added-to-wishlist”).hide();
e(“.ajax-success-modal”).find(“.added-to-cart”).show();
e(“.ajax-success-modal”).find(“.ajax-product-title”).text(p);
e(“.ajax-success-modal”).find(“.ajax_price”).text(amt);
e(“.ajax-success-modal”).find(“.ajax_qty”).text(r); t.updateDropdownCart()
},
error: function(n, r) {
t.hideLoading();
e(“.ajax-error-message”).text(e.parseJSON(n.responseText).description);
t.showModal(“.ajax-error-modal”)
}
})
},
it’s only receiving the values for quantity and iddata:
“quantity=” + r + “&id=” + n,Unfortunately, this is not something we can adjust for you. It really depends on how it was implemented.
The easiest way would be to find where the doAjaxAddToCart function is called serialize the form content and make the data variable receive this serialization.Basically, the AJAX is not pushing two variables the recurring app needs from AJAX:
shipping_interval_frequency
shipping_interval_unit_typeAs seen here:
– https://support.rechargepayments.com/hc/en-us/articles/360008830733-Using-custom-line-item-properties?source=search
– https://support.rechargepayments.com/hc/en-us/articles/360008683774-Adding-an-item-to-the-cart-with-AJAX?source=searchCould we please add this functionality to my template? It’s just two variables and I would like to keep the AJAX cart functional.
Thanks!
J
Sorry, we are not doing such custom work for third-party apps!
Sorry, we are not doing such custom work for third-party apps!
You must be logged in to reply to this topic.