Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Show Total number of sales
<?php
add_action( 'woocommerce_single_product_summary', 'show_total_number_of_sales', 11 );
function show_total_number_of_sales() {
global $product;
$units_sold = $product->get_total_sales();
if ( $units_sold ) echo '<p>' . sprintf( __( 'Összes eladás: %s', 'woocommerce' ), $units_sold ) . '</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment