JG0910 Posted May 22 Share Posted May 22 Hi, I am trying to use conditional logic so that when selecting the variant customisation = Yes a pop up form is displayed and when a user selects No they can add to cart. Can anyone help with this? Link to comment
sorca_marian Posted May 22 Share Posted May 22 Hi, I tested this code on a Product page of Squarespace 7.1 You can add it in a code block inside the product page that you want it. <script> document.addEventListener("DOMContentLoaded", () => { document.querySelector(".sqs-add-to-cart-button-inner").addEventListener("click", function(event){ var resultOfPopup = confirm("My message here"); if(resultOfPopup) { event.preventDefault(); event.stopImmediatePropagation(); } }); }); </script> "My message here" can be changed with your message but between the quotes. 👨🔧👨💻 Squarespace plugins 🙋♂️ Squarespace Custom Web Development & Design 📅 Notion alternative 📹 Squarespace Tutorials for free - YouTube📹 💯🚀 I have worked on over 200 Squarespace sites with custom code for over 9 years 🙋♂️ Let's connect on LinkedIn Link to comment
JG0910 Posted June 6 Author Share Posted June 6 https://www.customshinz.com/shop/p/personilised-shin-pads Hey I want something where we do not have to click add to cart to start the form, something where you can just type it in like so: https://www.thecasepeople.com/product-page/customised-tcp-mini-shin-pads-1 Link to comment
tuanphan Posted June 10 Share Posted June 10 On 6/7/2024 at 3:43 AM, JG0910 said: https://www.customshinz.com/shop/p/personilised-shin-pads Hey I want something where we do not have to click add to cart to start the form, something where you can just type it in like so: https://www.thecasepeople.com/product-page/customised-tcp-mini-shin-pads-1 You can consider using Custom Product Form. https://support.squarespace.com/hc/en-us/articles/205811218-Creating-a-custom-product-form Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment