Last active
March 10, 2019 22:54
-
-
Save Cleanse/129ea96a0f0622a00099d71d86028709 to your computer and use it in GitHub Desktop.
Created Retired tag, hide sold-out products, except on Retired category page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function () { | |
var divsToHide = document.getElementsByClassName("ProductList-item sold-out"); | |
for(var i = 0; i < divsToHide.length; i++){ | |
if(window.location.href.indexOf("Retired") > -1) { | |
return; | |
} | |
divsToHide[i].style.visibility = "hidden"; | |
divsToHide[i].style.display = "none"; | |
} | |
var divsToHideWrapper = document.getElementsByClassName("ProductList-grid clear"); | |
for (var x = 0; x < divsToHideWrapper.length; x++) { | |
divsToHideWrapper[x].style.display = "flex"; | |
divsToHideWrapper[x].style.flexWrap = "wrap"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated with flexbox to fix the 'float' + :nth-child(3n+1) + :nth-child(2n+1) css the default theme uses.