Display the default discounted price and percentage on Woocommerce products
woocommerce version 3 as Product object properties ca’t be accessed directly. Instead you should use available WC_Product methods. To format the prices you will use wc_price() dedicated formatting function. Now you can have (3 possibilities): 1) The saving price: add_filter( ‘woocommerce_get_price_html’, ‘change_displayed_sale_price_html’, 10, 2 ); function change_displayed_sale_price_html( $price, $product ) { // Only on sale…