Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use unit pricing in WooCommerce
add_action( 'woocommerce_get_price_html', 'wc_ninja_customize_price_html', 2, 10 );
function wc_ninja_customize_price_html( $price, $product ) {
// Enter your product's ID here
$product_id = 87;
if ( $product_id == $product->id ) {
$price .= ' ($2.00 per piece)';
}
return $price;
}
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.