All Collections
Help Articles for Old UI
Uncategorized
Force reload offer, check for ajax calls
Force reload offer, check for ajax calls
S
Written by Support
Updated over a week ago

Add this code to your liquid file (theme.liquid is recommended)

function openReplacement() {

this.addEventListener("load", function () {

if (

[

"/cart/add.js",

"/cart/update.js",

"/cart/change.js",

"/cart/clear.js",

].includes(this._url)

) {

$('.nudge-offer').remove();

InCartUpsell.prototype.findOfferWhenReady();

}

});

return open.apply(this, arguments);

} const open = window.XMLHttpRequest.prototype.open; window.XMLHttpRequest.prototype.open = openReplacement;

Did this answer your question?