This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

CloudwaysCDN — a powerful solution that offers superior performance and satisfied global audience for your business. Read More

WooCommerce Discount Cart

Updated on  December 5, 2017

2 Min Read
Reading Time: 2 minutes

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

Conclusion

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.

Share your opinion in the comment section. COMMENT NOW

Start Growing with Cloudways Today.

Our Clients Love us because we never compromise on these

About The Author

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:

Get Our Newsletter
Be the first to get the latest updates and tutorials.

THERE’S MORE TO READ.