A question that has been popping up quite a lot lately in the WooCommerce support forums is how do I display the total amount of units sold for a product on the product page. In this WooCommerce tutorial I will be showing you how to display this on the product page.

Luckily WooCommerce already takes care of the majority of work for us to do this as it automatically keeps track of the number of units sold for each product for reporting purpose, all we have to do it do retrieve the value and display it on the product page.

To display the number of units sold for a product add the following snippet of code to your theme’s functions.php file

This will result in the Units Sold text to display underneath the product title and price

WooCommerce number of units sold