Skip to content

Instantly share code, notes, and snippets.

@fabiensebban
Last active October 28, 2025 10:46
Show Gist options
  • Save fabiensebban/6737ea618dc371ba3105b606a8c4a222 to your computer and use it in GitHub Desktop.
Save fabiensebban/6737ea618dc371ba3105b606a8c4a222 to your computer and use it in GitHub Desktop.
Changes the "Start shopping" button URL.
const newURL = '{% if routes.root_url != '/' %}{{ routes.root_url }}{% endif %}/collections/all';
function changeButtonURL(newURL) {
const wishlistContainer = document.querySelector('ooo-wl-page-container');
if (!wishlistContainer) return;
const wishlistContent = wishlistContainer.shadowRoot.querySelector('ooo-wl-page-content');
if (!wishlistContent) return;
const wishlistPageContentInfo = wishlistContent.querySelector('ooo-wl-page-content-info');
if (!wishlistPageContentInfo) return;
wishlistPageContentInfo.shadowRoot.querySelector('a').setAttribute('href', newURL);
}
document.addEventListener('ooo-wishlist:page-viewed', () => {
setTimeout(() => {
changeButtonURL(newURL);
}, 100)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment