Jump to content

Recommended Posts

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
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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  ⬇️ 

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.