Created
July 4, 2014 04:43
-
-
Save vinacode/fbc94da546e076e74e0f to your computer and use it in GitHub Desktop.
WooCommerce add weight unit after price filter
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
<?php | |
/**================WooCommerce weight unit after price===================**/ | |
add_filter( 'woocommerce_price_html', 'woocommerce_custom_sales_price', 10, 2 ); | |
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 ); | |
function woocommerce_custom_sales_price( $price, $product ) { | |
return sprintf( __( '%s/kg', 'woocommerce' ), $price ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment