Jump to content

Add Button To Cart Page

Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Add to Code Injection Header

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() { 
		$('.CartFooter-checkout-28MW2').append('<div class="tuan"><a href="https://beaverhero.com">Button text</a></div>');
	});
</script>
<style>
  .tuan a {
    display: inline-block;
    height: auto;
    color: #ffffff;
    background-color: #272727;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
    line-height: 1em;
    font-weight: normal;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.1em;
    padding: 1.4em 2.8em;
    margin: 40px 0;
}
</style>

replace with your text, url

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

Thank you so much, @tuanphan!!

One more ask if you could help... I've included a "Continue Shopping" button on the cart page and I'd like to style it like the other buttons. Here is the coding that I've used to insert the button. Not sure where the styling code would need to be entered.

<script>
 var d1 = document.getElementById('sqs-cart-container');
 function goBack() {
 window.history.back();
}
 d1.insertAdjacentHTML('beforebegin', '<p><button onclick="goBack()"align="left">← Continue Shopping</button></p>');
</script>

Link to comment
  • 1 month later...

@tuanphan

How do I put the "continue shopping" link on the same row as the subtotal texts? Below is the code I used.

Thank you!!

<script>
  $(document).ready(function() { 
		$('<p style="text-align:left"><a href="http://www.fortsferryfarm.com/pickup-delivery">Continue Shopping</a></p>').insertBefore('.CartTable-subtotal-2nJjm');
	});
</script>

 

Screen Shot 2020-07-24 at 5.27.21 PM.png

Link to comment
16 hours ago, siweisong said:

@tuanphan

How do I put the "continue shopping" link on the same row as the subtotal texts? Below is the code I used.

Thank you!!


<script>
  $(document).ready(function() { 
		$('<p style="text-align:left"><a href="http://www.fortsferryfarm.com/pickup-delivery">Continue Shopping</a></p>').insertBefore('.CartTable-subtotal-2nJjm');
	});
</script>

 

 

Can you share link to cart page? 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
  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

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