Created
February 11, 2021 14:18
-
-
Save trueqap/ecbce4b7ae16950391b348a08fd7a11a to your computer and use it in GitHub Desktop.
Show Total number of sales
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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