Showing the number of units sold for products on the archive page is a great way to introduce Fear Of Missing Out (FOMO). It also gives your customers an indication of the most popular products in your store, perhaps influencing them to follow the crowd and pick the most popular product.Â
/**
* Snippet Name: WooCommerce Show Number Of Units Sold On Product Archive
* Snippet Author: ecommercehints.com
*/
add_action( 'woocommerce_after_shop_loop_item', 'ecommercehints_show_units_sold_product_archive' );
function ecommercehints_show_units_sold_product_archive() {
global $product;
echo '
' . $product->get_total_sales() . ' Units Sold';
}