Jump to content

Add a 'Continue Shopping' Link to shopping cart when products are in it

Recommended Posts

Site URL: https://www.skelafoods.com

Hey there!

Wondering if anyone knows how to add a 'Continue Shopping' button to the Shopping cart when there are existing products in it?

I'm using the 'Tremont' template.

site: www.skelafoods.com
Passcode: foods

The page is actually hidden as I'm currently developing it and we are going live asap...so the store page link is www.skelafoods.com/store-2 in case you need to add products to the cart to check.

THANK YOU!

 

Link to comment
  • 2 weeks later...
  • 2 months later...
6 hours ago, BethanWright said:

Saw an old post sharing how to with code injection but I can't seem to access page settings for cart page to do the code injection. Any suggestions?

Can you share link to that post? We can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 3 weeks later...

Carrie, I've seen many posts on this and no solid answers. I checked with CS and the answer is that it is not possible to have the "Continue Shopping" button show up when there are items in the cart, which is completely inefficient. The agent said she would submit it to the Squarespace developers as a feature request. Our best bet is for everyone to shoot an email to customer support asking to add this feature. The more requests they receive on it, the more they'll consider it necessary. Please shoot them an email so we can get this added sooner than later. Cheers!

Link to comment
  • 5 months later...

There's a solution here, available as a low cost add-on that will add a Continue Shopping button to the Cart:

Cart UX extension for Squarespace

6127C0D3-83F3-457F-BB2F-CA9C62E5595B.thumb.png.df2f2b98be712509a6df2a33bd59865f.png

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.
Catch up on all the release notes and announcements 2023 [for Circle members only] (there's a public version here)

Buy me a coffee

Link to comment
  • 1 month later...
On 6/5/2021 at 6:32 PM, Amsterixe said:

I have the same problem.

I have a Om template on Squarespace 7.0

Can you share link to your site? We can help easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

@Amsterixe

Back in November I did a version that replicates the text version SS does for an empty cart, for a cart with items. I've freshened it up.

Add the following to Settings > Advanced > Code Injection > HEADER.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Add the following to Settings > Advanced > Code Injection > FOOTER.

<script>

  $( ( ) => {
  
    /*
    
      add continue shopping message when cart has items
      
      Version       : 0.1d1
      
      SS Versions   : 7.0, 7.1
      
      Dependancies  : jQuery
      
      By            : Thomas Creedon < http://www.tomsWeb.consulting/ >
      
      */
      
    /*
    
      the following values are optional, if left empty default values will be
      provided. if the values have single quotes in them put a backslash before
      the single quotes. example: it's becomes it\'s
      
      */
      
    let notEmptyMessage = '';
    
    let continueShoppingLinkText = '';
    
    // do not change anything below, there be the borg here
    
    if ( location.pathname != '/cart' ) return; // bail if not cart
    
    if ( $( '.empty-message' ).length ) return; // bail if empty
    
    const selector = '[data-test=remove-item]';
    
    let continueShoppingLinkUrl = Static.SQUARESPACE_CONTEXT.websiteSettings
    
      .storeSettings.continueShoppingLinkUrl
      
    if ( ! continueShoppingLinkText )
    
      continueShoppingLinkText = 'Continue Shopping';
      
    if ( ! notEmptyMessage )
    
      notEmptyMessage = 'You have something in your shopping cart.';
      
    if ( continueShoppingLinkUrl != '/' )
    
      continueShoppingLinkUrl = '/' + continueShoppingLinkUrl;
      
    $( '<div class="not-empty-message">' +
    
      '<span>' +
      
        notEmptyMessage +
        
        '</span> ' + // space after the closing span
        
      '<a data-test="continue-shopping-link" href="' + continueShoppingLinkUrl +
      
        '">' +
        
        '<span>' +
        
          continueShoppingLinkText +
          
          '</span>' +
          
        '</a>' +
        
      '</div>' )
      
      .insertAfter ( '.cart-title' );
      
    $( document ).on ( 'click', selector, function ( ) {
    
      if ( $( selector ).length > 1 ) return; // bail if more than one
      
      $( '.not-empty-message' ).remove ( );
      
      $( document ).off ( 'click', selector );
      
      } );
      
    } );
    
  </script>

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
22 hours ago, creedon said:

@Amsterixe

Back in November I did a version that replicates the text version SS does for an empty cart, for a cart with items. I've freshened it up.

Add the following to Settings > Advanced > Code Injection > HEADER.


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Add the following to Settings > Advanced > Code Injection > FOOTER.


<script>

  $( ( ) => {
  
    /*
    
      add continue shopping message when cart has items
      
      Version       : 0.1d1
      
      SS Versions   : 7.0, 7.1
      
      Dependancies  : jQuery
      
      By            : Thomas Creedon < http://www.tomsWeb.consulting/ >
      
      */
      
    /*
    
      the following values are optional, if left empty default values will be
      provided. if the values have single quotes in them put a backslash before
      the single quotes. example: it's becomes it\'s
      
      */
      
    let notEmptyMessage = '';
    
    let continueShoppingLinkText = '';
    
    // do not change anything below, there be the borg here
    
    if ( location.pathname != '/cart' ) return; // bail if not cart
    
    if ( $( '.empty-message' ).length ) return; // bail if empty
    
    const selector = '[data-test=remove-item]';
    
    let continueShoppingLinkUrl = Static.SQUARESPACE_CONTEXT.websiteSettings
    
      .storeSettings.continueShoppingLinkUrl
      
    if ( ! continueShoppingLinkText )
    
      continueShoppingLinkText = 'Continue Shopping';
      
    if ( ! notEmptyMessage )
    
      notEmptyMessage = 'You have something in your shopping cart.';
      
    if ( continueShoppingLinkUrl != '/' )
    
      continueShoppingLinkUrl = '/' + continueShoppingLinkUrl;
      
    $( '<div class="not-empty-message">' +
    
      '<span>' +
      
        notEmptyMessage +
        
        '</span> ' + // space after the closing span
        
      '<a data-test="continue-shopping-link" href="' + continueShoppingLinkUrl +
      
        '">' +
        
        '<span>' +
        
          continueShoppingLinkText +
          
          '</span>' +
          
        '</a>' +
        
      '</div>' )
      
      .insertAfter ( '.cart-title' );
      
    $( document ).on ( 'click', selector, function ( ) {
    
      if ( $( selector ).length > 1 ) return; // bail if more than one
      
      $( '.not-empty-message' ).remove ( );
      
      $( document ).off ( 'click', selector );
      
      } );
      
    } );
    
  </script>

Let us know how it goes.

This worked great for me. Thank you!!

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.