WooCommerce How To Add Content Under The Proceed To Checkout Button On The Cart Page

WooCommerce Cart Page Trust Symbols

Pre-Requisites

There are no pre-requisites for this code snippet to work. Keep in mind this solution consists of two code snippets, one to display the content and one to style it.

How To Implement This Solution?

Add these two code snippets as separate entries in either your active child theme’s functions.php file or the Code Snippets plugin.

About this Solution

How many times have you bought something online and seen trust symbols near the proceed to checkout button on the cart page? “30 Day Money Back Guarantee” or “Secure Checkout” are popular examples. By default, there are no trust symbols or content under the proceed to checkout button on the cart page. But in this guide, we’ll show you how to add content under the proceed to checkout button on the cart page by using the woocommerce_after_cart_totals hook. Using this snippet, you’ll be able to add trust symbols, shipping information, or any other custom message you like!

Code Solution

For this solution two work, we have provided two separate code snippets. The first displays the actual content and the other styles it properly as shown in the example.

Snippet 1

				
					 /**
* Snippet Name:		WooCommerce How To Add Content Under The Proceed To Checkout Button On The Cart Page
* Snippet Author:	ecommercehints.com
*/

function action_woocommerce_after_cart_totals(  ) {
    echo '<div id="cart-trust-symbols"><i class="fas fa-lock"></i> Secure Checkout</div>';
};       
add_action( 'woocommerce_after_cart_totals', 'action_woocommerce_after_cart_totals', 10, 0 );
				
			

Snippet 2

				
					add_action( 'wp_head', function () {
if (is_cart()) { ?>
<style>
#cart-trust-symbols {
color:green;
text-align:center;
}
</style>
<?php } } );
				
			

Snippet Benefits

  • Trust symbols give customers confidence to continue in the checkout proces
WooCommerce Conversion Rate Optimisation (CRO) eBook
100 WooCommerce Conversion Rate Optimisation Tips

Leave a Reply

If you are going to write code in the comments, please wrap it between code tags.

Your email address will not be published. Required fields are marked *

Other Recent Guides

Subscribe To Emails

Get exclusive WooCommerce tips that I only share with email subscribers

Join hundreds of other subscribers