LindseyMexico14 Posted April 24, 2022 Share Posted April 24, 2022 Site URL: https://swordfish-plantain-5p63.squarespace.com/furniture https://swordfish-plantain-5p63.squarespace.com/furniture (website link) In the furniture section of the store there is an inquire for price button that won't show up first load, until the page is refreshed it will show up - sometimes the ability to buy is still allowed as well which my client doesn't want. attached is the JS script she is using, is there a problem with the code or does it not work well with Squarespace platform? <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(function() { $("<a class='checkoutbutton' href='/contact/'>Inquire for Order</a>").insertAfter(".ProductItem-details-share"); }); </script> <style> .checkoutbutton { font-family: tradegothic-bold; font-size: 12px; text-transform: uppercase; color: #fff; font-weight: normal; font-style: normal; text-align: center; text-decoration: none; padding: 14px; max-width: 200px; background-color: #070906; order:9; border:2px solid #070906; } .checkoutbutton:hover { color: #070906; background-color: #fff; } .sqs-add-to-cart-button{display:none !important} </style> Link to comment
paul2009 Posted April 24, 2022 Share Posted April 24, 2022 1 hour ago, LindseyMexico14 said: there is an inquire for price button that won't show up first load, until the page is refreshed it will show up - sometimes the ability to buy is still allowed as well which my client doesn't want. This is because the code hasn't been written to work with the Ajax Page Loading feature which this site's Brine-family template uses. You can either disable this feature in Design > Site Styles, or you can replace the code. Disabling Ajax Page Loading will reduce site performance (you can read more in my guide). I'll also mention that the code you are using is not very efficient and is using an old version of jQuery which has vulnerabilities. If you are looking for a paid add-on that is fully supported and won't have these issues, you may want to take a look at our Product Enquiry Form extension. This form automatically provides the site owner with details of the product when a user submits a form. Was this post helpful? Please give feedback by clicking an icon below ⬇️ 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. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
LindseyMexico14 Posted April 27, 2022 Author Share Posted April 27, 2022 On 4/24/2022 at 10:39 AM, paul2009 said: This is because the code hasn't been written to work with the Ajax Page Loading feature which this site's Brine-family template uses. You can either disable this feature in Design > Site Styles, or you can replace the code. Disabling Ajax Page Loading will reduce site performance (you can read more in my guide). I'll also mention that the code you are using is not very efficient and is using an old version of jQuery which has vulnerabilities. If you are looking for a paid add-on that is fully supported and won't have these issues, you may want to take a look at our Product Enquiry Form extension. This form automatically provides the site owner with details of the product when a user submits a form. Was this post helpful? Please give feedback by clicking an icon below ⬇️ Great thank you so much for the help! I will look into this 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