nevercrox.com

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

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 The Snippet

Have you ever seen trust symbols like “30 Day Money Back Guarantee” or “Secure Checkout” near the proceed to checkout button when shopping online? These symbols build trust, but by default, WooCommerce doesn’t include any content under this button on the cart page. In this guide, we’ll show you how to use the woocommerce_after_cart_totals hook to add your own content underneath. With this snippet, you can insert trust symbols, shipping details, or any other custom message you like!

Code Snippet 1
/**
* Snippet Name:		WooCommerce How To Add Content Under The Proceed To Checkout Button On The Cart Page
* Snippet Author:	Nevercrox Solutions
*/

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 );
 
Code Snippet 2
add_action( 'wp_head', function () {
if (is_cart()) { ?>
<style>
#cart-trust-symbols {
color:green;
text-align:center;
}
</style>
<?php } } );
 

Just Added Blogs

Need A Specifc Blog ?

Request A Blog

Check Out More Related Snippets