Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Anzahl der verkauften Produkte in der WooCommerce Produktbeschreibung anzeigen
/*
* Anzahl der verkauften Produkte in der WooCommerce Produktbeschreibung anzeigen
*
*/
add_action( 'woocommerce_single_product_summary', 'wc_product_sold_count', 11 );
function wc_product_sold_count() { global $product;
$units_sold = get_post_meta( $product->id, 'total_sales', true );
echo '<p>' . sprintf( __( 'Verkaufte Produkte: %s', 'woocommerce' )
, $units_sold ) . '</p>'; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.