Get a fast, conversion-focused WooCommerce theme in 2024. Switch to Shoptimizer.

Home Documentation Shoptimizer Code Snippets Display total savings within the mini cart

Display total savings within the mini cart

This snippet looks at including the total savings as a line item in the slide out mini cart. This isn’t standard WooCommerce functionality but inspired by this eCommerce conversions video I decided to make my own.

The final result should look like this.

Total savings within mini cart

Because of the way the mini cart hooks are setup I had to use some order CSS to arrange the “You save” bar at the top.

Add the following code within the Shoptimizer Child theme’s functions.php file or via the Code Snippets plugin.

Success!

The discount has been applied. You will see it when you checkout.

There has been a problem

Unfortunately this discount cannot be applied to your cart.

$50
Off

Do you want a whopping $50 off Shoptimizer for WooCommerce?

Click the button below to get Shoptimizer for only $49. (Regular price: $99).
This is a special launch offer for today only.
Get it before it is gone!