Jump to content

EFIC

Member
  • Posts

    8
  • Joined

  • Last visited

EFIC's Achievements

  1. Hi, I'm trying to fix a functionality issue with some code. What I'm basically trying to do is to make a red square turn green when a specific product quantity selector's value is 2 or more. Here is the code I'm currently using : <script> document.addEventListener('DOMContentLoaded', function () { // Replace 'your-product-id' with the actual ID of your product block var productBlock = document.getElementById('block-yui_3_17_2_1_1706114078580_5010'); if (productBlock) { // Find the quantity selector within the product block var quantitySelector = productBlock.querySelector('.product-quantity-input'); // Find or create the square element var square = productBlock.querySelector('.custom-square'); if (!square) { square = document.createElement('div'); square.className = 'custom-square'; productBlock.appendChild(square); } // Function to update the square color based on the quantity function updateSquareColor() { // Use input event instead of change var quantity = parseInt(quantitySelector.value, 10); // Update the square color based on the quantity square.style.backgroundColor = quantity > 1 ? 'green' : 'red'; } // Attach the update function to the input event quantitySelector.addEventListener('input', updateSquareColor); // Initial color update updateSquareColor(); } }); </script> I used ChatGPT to make that code since I don't have the required knowledge in JavaScript yet. The red square appears, but it doesn't turn green when the quantity is changed (either to 2 or more). I would like some help to find out what's not working and how to fix it, or if there are any other solutions. Here is the URL : www.judorivesud.com/test-1 Here is the password : test-1-jrs Thank you
  2. Hi MaryPhilip_, Yes that's the functionality that I was looking for, but without the price tag. Are there any options?
  3. Hello! I want to know if it's possible to make a custom button linked to a form, so that it acts like the ''Lightbox'' option on form blocks. I would like my custom button to open that form when clicked. Also if possible, I want to put that feature on a text box. Here is the page URL on which I want to make that happen : www.efic-international.com/semaine-de-relache Thanks in advance!
  4. Hi everyone, I was wondering if there is a way to add a reduction to a product in the cart even if it repeats in the cart. I have a problem where my clients can add multiples of the same product in the cart and I've added a reduction to take 40% off that specific product. The thing is that the reduction only works on one of the products in the cart, even though they added the same product but just multiple times. How can I fix my problem? Thanks
  5. I'm trying to set some images to scale up then overlay in front of other images when hovered over. The problem I'm having is I can't get the z-index to work. I've tried putting it in a code block, then in the page's code but nothing works for now. How can I make the image's z-index higher when hovered over? Here is the site URL : https://www.judorivesud.com
  6. Hi @MayaViolet, While trying your solution I got another idea which worked! I was trying to input your code in the page's CSS, which didn't work sadly, then I had the idea of putting the button's code in the pages CSS, which worked! I think the page's CSS has a higher z-index than what goes straight on the page. Thank you for giving me the idea!
  7. Hello everyone, I have a button on the bottom left that's fixed in position to follow the page scrolling. The thing is that some of the text and the images overlap over the button, which I don't want. I've tried fixing it with the z-index but nothing seems to work. How can I make it be on top of everything? Here is the URL : EFIC (efic-international.com) Thanks
  8. Hi, We're currently switching our website from Shopify to Squarespace and to make the switch without losing our SEO we need to make our new site as close to the old site as possible. I'm currently having trouble finding a way to replicate some functions on Squarespace without using code which I'm not an expert in. I want to have a text carousel like on this page Nos écoles (efic-international.com) I want to know if there's a way to make multiple text blocks fuse into a carousel to get at least the look similar to the old site or if there's another way to make a text only carousel with or without code. Bonus points if the small text under can be used to change slides. Here is the URL to the old and new site : Old : EFIC (efic-international.com) New : https://dahlia-ellipse-4xr8.squarespace.com/ Thanks in advance
×
×
  • 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.