WooCommerce Discount Cart

by Owais Alam  December 5, 2017

This is the season of discounts. Every WooCommerce store is offering discounts of all description to take advantage of the holiday craze.

WooCommerce Discount Cart

However, displaying the total price and the discount could pose some difficulties for WooCommerce Single Product pages and product listings. In many cases, the price breakdown is present at the bottom of the page. However, the developers could easily present an improved breakdown that displays the price after discounts and the discounted amount.

The following code snippet will add this functionality to the WooCommerce stores. It is important to note that with appropriate modifications, this snippet could be used to display other information such as:

  • Total Sales
  • Total Orders
  • Total of All Shipping Costs
  • Total of All Discounts Used
  • Total of All Items Ordered
  • Total Sales Per Item

Put the following snippet in the functions.php:

Here is is how the output of the snippet would look like. As you could see, the discount is shown on a separate line.

Secure cart


In this article I have discussed  how to display total discount at WooCommerce cart page. with some modifications, you could display several other price attributes as well. If you need help with the code, do leave a comment below.

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Owais Alam

is the WordPress Community Manager at Cloudways – A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at owais.alam@cloudways.com

Stay Connected:

You Might Also Like...