Ah, I just went to Open AI and it it gave me a code that worked 🙂 Slightly blown away!
<script> function hidePriceForSoldOutProducts() { const products = document.querySelectorAll(".product"); products.forEach((product) => { const soldOutElement = product.querySelector(".product-mark.sold-out"); if (soldOutElement) { const priceElement = product.querySelector(".product-price"); if (priceElement) { priceElement.style.display = "none"; } } }); } // Call the function once the page has loaded to hide the price if products are sold out. window.addEventListener("load", hidePriceForSoldOutProducts); </script>