Showing the number of product units sold on the single product page is a great way to introduce Fear Of Missing Out (FOMO). You can highlight how many products are sold to let customers know a product’s popularity. This particular solution shows the number of products sold under the add to cart button, somewhere the customer is bound to see it.
/**
* Snippet Name: WooCommerce Show Number Of Units Sold On Product Page
* Snippet Author: ecommercehints.com
*/
add_action( 'woocommerce_after_add_to_cart_button', 'ecommercehints_show_units_sold_product_page' );
function ecommercehints_show_units_sold_product_page() {
global $product;
echo '
Units Sold: '. $product->get_total_sales();
}