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

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

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.

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 1

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


If you see an answer that was helpful please consider hitting the 121238226_Screenshot2019-11-02at14_53_39.png.0416997a5e856e0159fa1edbd624659e.png button on the right. 

Need help with your website or online store? Feel free to get in touch.

thompsonweb.design

Share this post


Link to post
  • 0
Posted (edited)

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

Share this post


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. 


World-class Squarespace Developer and Squarespace Circle Leader with a strong reputation on the Squarespace Forum.
I'm trusted by hundreds of Squarespace users worldwide, including designers, freelancers, business owners and big agencies.

I can tackle anything from small tweaks to full websites and I'm available for short and long bookings (min. 1 hour).
Book via my website giving as much notice as possible. Note that I'm usually booked six weeks in advance for jobs longer than an hour.
Prebuilt Squarespace Extensions
Custom Squarespace Extensions: Tell me about the functionality you need

 

Share this post


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. 


If you see an answer that was helpful please consider hitting the 121238226_Screenshot2019-11-02at14_53_39.png.0416997a5e856e0159fa1edbd624659e.png button on the right. 

Need help with your website or online store? Feel free to get in touch.

thompsonweb.design

Share this post


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