WooCommerce Add Content At The Top Of The Mini-Cart

WooCommerce Minicart showing a custom title


There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About this Solution

By default, the WooCommerce mini-cart doesn’t even have a title. This quick guide shows you how you can add custom content to the very top of the mini-cart. If you find your custom text isn’t quite displaying at the top, tweak the priority number in the code. You’ll be wanting to use HTML and CSS to style the title as desired.

* Snippet Name: 	WooCommerce add content to the top of the mini-cart.
* Snippet Author:	ecommercehints.com

function ecommercehints_minicart_top_content() { 
    echo 'My Basket';

add_action( 'woocommerce_before_mini_cart', 'ecommercehints_minicart_top_content', 10 );
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