Skip to content

Instantly share code, notes, and snippets.

@MarkKevin08
Last active January 5, 2024 06:35
Show Gist options
  • Save MarkKevin08/8d5415629764616c9128d2cf1e287729 to your computer and use it in GitHub Desktop.
Save MarkKevin08/8d5415629764616c9128d2cf1e287729 to your computer and use it in GitHub Desktop.
If -0%, then hide this div - Frequently Bought Together
const divs = document.getElementsByClassName('product-bundle__discount-label');
for (let x = 0; x < divs.length; x++) {
const div = divs[x];
const content = div.textContent.trim();
if (content == '0%' || content == '-0%') {
div.style.display = 'none';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment