Skip to content

Instantly share code, notes, and snippets.

@crftr
Last active January 3, 2024 23:01
Show Gist options
  • Save crftr/a2b690ef07ce204859b6e2ba16ec1489 to your computer and use it in GitHub Desktop.
Save crftr/a2b690ef07ce204859b6e2ba16ec1489 to your computer and use it in GitHub Desktop.
When developing a SuiteCommerce Advanced site, it's nice to browse against the local version of code. This browser bookmarklet will add the "-local" to the current URL.
javascript: (function () {
var locationStr = window.location.toString(),
shopping = SC.SESSION.touchpoints.viewcart.replace(
"goToCart",
"shopping-local"
);
if (/-local.ssp/.test(locationStr)) {
window.location = locationStr.replace("-local.ssp", ".ssp");
} else if (/(my_account|checkout).ssp/.test(locationStr)) {
window.location = locationStr.replace(".ssp", "-local.ssp");
} else {
var path = window.location.pathname.substring(1);
window.location = window.location.origin + shopping + "#" + path;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment