Skip to content

Instantly share code, notes, and snippets.

@stefbowerman
Created July 24, 2018 17:56
Show Gist options
  • Select an option

  • Save stefbowerman/1c16cd0ba168cfa71b98bc47ed9aed81 to your computer and use it in GitHub Desktop.

Select an option

Save stefbowerman/1c16cd0ba168cfa71b98bc47ed9aed81 to your computer and use it in GitHub Desktop.
// Alter this function with this last line
var xsappinitfrontend = function(jQueryxsAppxsApp) {
// Main function code...
// ends with..
// jQueryxsApp('#cross-sell').append(settingsoutput);
// Add the following line
jQueryxsApp(window).trigger('xselldone');
}
// And then add this bit at the bottom of all the xsell stuff
// Right after the if / else statement that starts with
// ` if ((typeof jQueryxsApp === 'undefined') || (parseFloat(jQueryxsApp.fn.jquery) < 3)) { `
(function($) {
var $window = $(window);
var xsellDone = false;
$window.on('xselldone', function() {
xsellDone = true;
});
if(Flow) {
Flow.set('on', 'ready', function() {
if(xsellDone) {
Flow.localize();
}
else {
// Xsell hasn't finished, localize once it's done
$window.on('xselldone', function() {
Flow.localize();
});
}
});
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment