Created
January 13, 2017 22:20
-
-
Save WPprodigy/bc9992c483186b9dcea67822e15ff871 to your computer and use it in GitHub Desktop.
Use unit pricing in WooCommerce
This file contains hidden or 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