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

Add new text in add to cart box


Maribeltb

Question

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

Hello, I'd like to show the text "View Shopping Bag" in the add to cart box , after someone has added a product. 

 Now some people get confused when they add a product, and maybe this will help.

Example https://www.net-a-porter.com/en-us/shop/product/jimmy-choo/narisa-knotted-leather-sandals/1306082

 

image.png.f08fc46565ec5067563bce9119c8a9c0.png


Can anyone help me with this?

Thanks!

Maribel 

Edited by Maribeltb
Link to comment

5 answers to this question

Recommended Posts

  • 0

I'm looking for this also -  the plugin is not the solution for me. Any code to target that button after it's clicked? 

I used your code, @tuanphan to change Add to Cart text on the button before the action and it works great. (thanks!) I tried replicating it targeting the button after the action but with no success.

I want the text after button is clicked to remain "added" - not revert to Add to Cart.

tia.

retrographicshop.com

Edited by junecz
Link to comment
  • 0

@junecz

Add the following to Store Settings > Advanced > Page Header Code Injection for the store page.

<script>

  $( ( ) => {
  
    /*
    
      begin change add to cart button original label
      
      SS Version : 7.1
      
      */
      
    const label = 'Added';
    
    // do not change anything below, there be the borg here
    
    if ( ! $( '.ProductItem' ).length ) return;
    
    $( '.sqs-add-to-cart-button' ).attr ( 'data-original-label', label );
    
    // end change add to cart button original label
    
    } );
    
  </script>

This is for v7.1.

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
  • 0

Please move the following from Settings > Advanced > Code Injection > FOOTER to Settings > Advanced > Code Injection > HEADER.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>

My code could not run because the jQuery library had not yet been loaded.

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

Create an account or sign in to comment

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

×
×
  • Create New...