Mini-Cart

WooCommerce Mini Cart Visual Hooks Guide

WooCommerce Mini Cart Visual Hooks Guide

Pre-Requisites

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

Being able to customise the mini cart should be as easy as any other part of WooCommerce. WooCommerce don’t make it particularly easy to find the hooks they publish for each element. Even when found, it’s not exactly easy to see which hooks display where. We gave up in the end and created a visual guide to hooks available in the mini cart!

Mini Cart Hooks

// These are the six hooks WooCommerce have published for the mini cart

woocommerce_before_mini_cart
woocommerce_before_mini_cart_contents
woocommerce_mini_cart_contents
woocommerce_widget_shopping_cart_total
woocommerce_widget_shopping_cart_before_buttons
woocommerce_widget_shopping_cart_after_buttons

Pre-Coded Example

/**
* Snippet Name:     Show custom text at the top of the WooCommerce Mini Cart.
* Snippet Author:   ecommercehints.com
*/

function action_woocommerce_before_mini_cart() {
    echo "This will appear at the very top of the mini cart";
};

add_action( 'woocommerce_before_mini_cart', 'action_woocommerce_before_mini_cart', 10, 0 );

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 20% off on your first month with us.

26027
WELCOME OFFER