Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fabiensebban/d5c9213d657689f3b0d6db277ff3f778 to your computer and use it in GitHub Desktop.
Save fabiensebban/d5c9213d657689f3b0d6db277ff3f778 to your computer and use it in GitHub Desktop.
// This snippet hides the add to cart and selector from the wishlist page
document.addEventListener('DOMContentLoaded', () => {
const callback = () => {
Array.from(document.querySelectorAll('ooo-wl-select-option')).forEach((item) => item.style.display = 'none');
Array.from(document.querySelectorAll('ooo-wl-button-add-to-cart')).forEach((item) => item.style.display = 'none');
}
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, { attributes: true, childList: true });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment