Jump to content

tomcoxart

Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by tomcoxart

  1. 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>
  2. Hi All, I've attempted putting all of the above codes in to my website header for my online shop, but none of them seem to work. My website is https://www.tomcoxstudio.com/ I'd like to have all the products which are sold to have the price hidden. Hopefully somebody can help 🙂 Thanks!
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.