Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 2

How to add a Go To Cart button on the product page


AndyF

Question

When you select an item to buy in the store, there's an Add to Cart button. When you click it, the button text changes momentarily to Adding... and the changes to Added. But at that point, in order for the user to Checkout, they have to (know to) scroll back to the top of the page to find the Cart(1) link. I'd like there to be two buttons near the Added button that say Continue Shopping and Go To Cart. Can anybody help me with how to add these buttons? Thank you.

Link to post
  • Answers 9
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Yes, I wrote a blog post about how to make a pop-up appear when a user adds an item to their cart which gives them the option to continue shopping or proceed to their cart.  https://thompsonweb.d

Pretty much what @paul2009 said, it’s meant more as a starting off point. As you can imagine when trying to provide a solution such as this, there are a lot of different variables in how a Squarespace

When you select an item to buy in the store, there's an Add to Cart button. When you click it, the button text changes momentarily to Adding... and the changes to Added. But at that point, in order fo

Posted Images

9 answers to this question

Recommended Posts

  • 0

This script is great. However, when I load these three scripts I get text that pops up in the top left corner of the page on loading of my cover page. Is this typical behavior? It doesn't seem to do it on the "behind the scenes" site that I am still building. Is there any way to avoid this? See video attached --first 10 seconds only unless you want to watch me figure out where my QuickTime app went. 😃

Also attached is a screenshot of the header text. I have a feeling I have typo here trying to copy/paste several injections for various customizations and plugins.

 

Screen Shot 2020-01-08 at 4.11.41 PM.png

Edited by JonathanK
Link to post
  • 0

@JonathanK In summary, it's expected behaviour for this piece of code but I can see why this would be a problem on a live site.

It's due to the way the sample of code has been written. Snippets provided free on forums are often written quickly to show the art of the possible, to help someone decide whether a solution might help them. Issues like this "flash of unstyled content" are to be expected. These snippets are simply not designed to be used in place of tested, paid solutions. They are "get you started" code that shows what is possible and allows you to (a) decide if Squarespace might be suitable and (b) consider whether it is worth hiring a developer to customise an element of your site.  

This particular snippet includes a section of HTML (lines 2 to 12) that creates the buttons. It is being added to the top of every page on the site, regardless of whether the page is a product page or has an 'Add to Cart' button on it. That's why you see it on your cover page, even though there's no need for the buttons on this page. If the developer had been paid to write this, they would have used JavaScript instead, checking for the Cart button first and, only when it is found, creating the buttons on the page. 

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digital, a specialist company helping Squarespace users by building the features that Squarespace didn't include.
Explore our range of Squarespace Extensions, including the Wishlist, and Datepicker Extension or book a Squarespace Expert for 1:1 help. Note that links in my posts may be affiliate links.

Link to post
  • 0

Pretty much what @paul2009 said, it’s meant more as a starting off point. As you can imagine when trying to provide a solution such as this, there are a lot of different variables in how a Squarespace website might be configured from AJAX to the specific templates, product blocks vs product pages... So one for all solutions like this do sometimes present problems. 

It was basically designed to work in a wide variety of use cases whilst also being simple enough for the lay person or anyone else who would like to develop on it further to decipher. In addition it was also designed in a way that makes it relatively easy to maintain incase something fundamentally changes on Squarespace. Unfortunately that means that in some instances it does cause some less then ideal situations like this one with the cover page. 

Really the only reason I suggest you put the html code in the global header is incase you have AJAX enabled. If you don’t then you can simply put it into the specific product page header which will solve your problem. 

Link to post
  • 0

I didn't see this thread working on the same problem, but here is my solution. Seems to work well for matching the button style of "Add To Cart".

 

 

Link to post
  • 0
On 12/12/2019 at 10:51 AM, ThompsonWebDesign said:

Yes, I wrote a blog post about how to make a pop-up appear when a user adds an item to their cart which gives them the option to continue shopping or proceed to their cart. 

https://thompsonweb.design/squarespace-website-tips/added-to-cart-pop-up

Hi, If I use your link I don't see your blog post, but directly your shop to buy a plug-in to make a pop-up appear... I'm in the right place?

Link to post
  • 0
28 minutes ago, francescalo said:

Hi, If I use your link I don't see your blog post, but directly your shop to buy a plug-in to make a pop-up appear... I'm in the right place?

Yes, you are in the right place.

The plugin has now been completely re-written using a different method to observe when an item is added to a users cart. The result is a much more versatile plugin. Whereas before it would only appear once per page load, it now appears every time an item is added to a users cart. In addition, the old version was limited to one add to cart button per page whereas the new one will work for every add to cart button on the page which is useful if you use product blocks. 

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...