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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
  • 1 month later...

@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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.