Neilshy Posted October 29, 2019 Share Posted October 29, 2019 Hi there. I've just changed my template from Montauk to Brine. On Montauk, i had a little custom code that enabled me to click on the 'shop' button and have that redirected to an unlinked page (basically a categories page that I had created) Originally on Montauk, when you clicked 'shop' it took you nowhere and only opened up the dropdown categories. Since changing over to Brine, this link doesn't work and clicking on shop just takes me to my first product page. The code still looks as though it's in there. Any ideas on what i can do to get it working again? Link to comment
colin.irwin Posted October 29, 2019 Share Posted October 29, 2019 A link to your site would be very useful in order to determine what's going wrong with your script. If you're looking for a Squarespace Developer, drop me a line. Link to comment
Neilshy Posted October 29, 2019 Author Share Posted October 29, 2019 https://littleanvil.com/ When you click on shop it take you here - https://littleanvil.com/shop I'm trying to get it to take me here (the hidden page) - https://littleanvil.com/categories Thanks! Link to comment
Neilshy Posted October 29, 2019 Author Share Posted October 29, 2019 This was the code that worked with Montauk up until I changed template earlier today... <script> $(function() { $('.main-nav li a').each(function () { if ($(this).text() == 'Shop') { $(this).attr('href','https://littleanvil.com/categories/'); $(this).attr('onclick','true'); } }); }); </script> Link to comment
colin.irwin Posted October 29, 2019 Share Posted October 29, 2019 Do you have a script tag anywhere that calls in jQuery? If you're looking for a Squarespace Developer, drop me a line. Link to comment
Neilshy Posted October 29, 2019 Author Share Posted October 29, 2019 Honesty, I have no idea - if that was something i would have manually added then id say no as I haven't heard of it before (i'm fairly novice!...) Link to comment
colin.irwin Posted October 29, 2019 Share Posted October 29, 2019 You should try replacing your current script with the following <script> window.Squarespace.onInitialize(Y, function(){ $('.Header-nav-folder-title[href = "/shop"]').attr('href', '/categories/'); }); </script> If you're looking for a Squarespace Developer, drop me a line. Link to comment
Neilshy Posted October 29, 2019 Author Share Posted October 29, 2019 God, you're a legend. That worked immediately. Can you come live with me and fix all of the problems please! Thank you so much - super kind of you to assist Link to comment
Neilshy Posted October 29, 2019 Author Share Posted October 29, 2019 I've just book-marked your website for future reference. i truly appreciate your help, thanks Colin! Link to comment
Rachel12345 Posted November 4, 2019 Share Posted November 4, 2019 Great question! I have a similar one.. Colin, is there a script I can use so that an "add to cart" (.sqs-add-to-cart-button-wrapper) button does nothing when clicked on (ie. does not add anything to a cart or change text)? I'd like to change the text on these buttons to "Please Call ##" and make them unclickable. Thank you!!! Rachel Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.