Skip to content

Instantly share code, notes, and snippets.

@rgranadino
Created February 2, 2012 21:48
Show Gist options
  • Save rgranadino/1725978 to your computer and use it in GitHub Desktop.
Save rgranadino/1725978 to your computer and use it in GitHub Desktop.
Fixing formatCurrency method in magento's js.js (pre 1.6) to not stomp out omniture's global 's' object
if (formatCurrency) {//Encapsulate formatCurrency to prevent global variable leaking....
formatCurrency = (function(f) {
var origMethod = Object.clone(f);
return function(price, format, showPlus) {
return origMethod(price, format,showPlus);
};
}(formatCurrency));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment