bluecrown77 Posted January 28, 2022 Posted January 28, 2022 Hello - I would like to change what happens when visitors click the "Add to Cart' button on my product pages. I know there is an option in the product editor to just change the text of the button, but instead of just changing the text, I would like to make it so that when someone clicks the button, it takes them to the Contact page (instead of adding the product to the cart). Is this possible? Thank you very much.
tuanphan Posted January 29, 2022 Posted January 29, 2022 Hi. This is possible. For all products or specific product? Can you share link to a product? We can help easier. bluecrown77 1 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!)
bluecrown77 Posted February 5, 2022 Author Posted February 5, 2022 Thank you Tuan - I've just sent you a forum message with the details
conversiontracking Posted February 5, 2022 Posted February 5, 2022 (edited) Add to code injection header <!-- jQuery 3 --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> //ADD CONTACT PAGE URL HERE ⬇️⬇️⬇️ var contactPageUrl = "/contact"; //ADD CONTACT PAGE URL HERE ⬆️⬆️⬆️ $( document ).ready(function() { $(".sqs-add-to-cart-button").click(function(){ event.preventDefault(); window.location.href = contactPageUrl; }) }); </script> And feel free to get in touch if you need to hire a pro 🙂 Edited February 5, 2022 by codeandtonic tuanphan 1 Freelance Squarespace developer making plugins like Full-Width Blocks, Hover effects for grid gallery and the Darkmode plugin. I know Squarespace inside out and I'm able to solve pretty much any Squarespace code problem. Get in touch here!
bluecrown77 Posted February 19, 2022 Author Posted February 19, 2022 On 2/5/2022 at 1:27 PM, codeandtonic said: Add to code injection header <!-- jQuery 3 --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> //ADD CONTACT PAGE URL HERE ⬇️⬇️⬇️ var contactPageUrl = "/contact"; //ADD CONTACT PAGE URL HERE ⬆️⬆️⬆️ $( document ).ready(function() { $(".sqs-add-to-cart-button").click(function(){ event.preventDefault(); window.location.href = contactPageUrl; }) }); </script> And feel free to get in touch if you need to hire a pro 🙂 Hi codeandtonic - thank you for your reply but I think that I am unable to make this change (I am on the most basic squarespace plan). Is there another option to achieve what I'm looking for? Thank you.
paul2009 Posted February 19, 2022 Posted February 19, 2022 On 1/28/2022 at 5:56 AM, bluecrown77 said: I would like to make it so that when someone clicks the [Add to Cart] button, it takes them to the Contact page. On the Personal Plan you cannot change the Add to Cart button but you can do the following: Add some Custom CSS to hide the Add to Cart button. Within the product description, add a link for the contact page. Add some further CSS to style the link to look like an Add to Cart button. As you didn't include a link to your site in your question I wasn't able to provide you with the exact details but this should get you started. Did this help? Please give feedback by clicking an icon below ⬇️ conversiontracking 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
conversiontracking Posted February 23, 2022 Posted February 23, 2022 On 2/19/2022 at 9:27 PM, bluecrown77 said: Is there another option to achieve what I'm looking for? Thank you. Paul2009 gave a nice answer. With CSS you'd need to be really creative. I'd suggest paying for a better plan if it's possible. But the best you can do is add a button block, Add to Cart as title and link as the destination. Then custom CSS to hide the real add to cart button .ProductItem-details .sqs-add-to-cart-button-wrapper { display: none !important; } Freelance Squarespace developer making plugins like Full-Width Blocks, Hover effects for grid gallery and the Darkmode plugin. I know Squarespace inside out and I'm able to solve pretty much any Squarespace code problem. Get in touch here!
markjwarman Posted March 10, 2023 Posted March 10, 2023 Hi @codeandtonic Thanks for the above - I've given it a shot and although the script does redirect to the contact page, it looks like the default action of attempting to add the product to the cart still gets triggered. Any chance you could take a look for me?https://tarpon-glockenspiel-p4x5.squarespace.com/shop/p/lawrence-jacket-zczh9 password: barnfield Thanks! Mark
SarahSchools Posted July 20, 2023 Posted July 20, 2023 Hi! I was wondering if I could get your help removing the add to cart button on certain items on my website, and other items changing it to a link. I'm an artist and I'd like to show some work that is not for sale, as well as have listings for other items that are for sale through another site where I can link to where someone can buy them. Here's a product I want to remove the "add to cart" button:https://sarahschools.com/fine-art/p/sullivans-18 Here's a product I want to link somewhere else:https://sarahschools.com/fine-art/p/marie-me-oil-pastel And I want it to link to: https://shopdocent.com/pages/sarah-alexander-schools Thank you so much for the help!!!
creedon Posted July 21, 2023 Posted July 21, 2023 Quote removing the add to cart button on certain items on my website Quote other items changing it to a link Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment