Created
October 15, 2017 18:05
-
-
Save kabbo508/e643dae7a1b05b73cabc84522f055a73 to your computer and use it in GitHub Desktop.
Add text before sale price only in Woocomemrce
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
function bd_sale_price_html( $price, $product ) { | |
if ( $product->is_on_sale() ) : | |
$return_string = str_replace( '<ins>, '<ins><br>Sale Price: ', $price); | |
return $return_string; | |
else : | |
return $price; | |
endif; | |
} | |
add_filter( 'woocommerce_get_price_html', 'bd_sale_price_html', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment