Use unit pricing in WooCommerce
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
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