add_filter( 'woocommerce_get_price_html', 'ts_custom_price', 10, 2 ); function ts_custom_price() { global $product; if ($product->is_on_sale()) { if( $product->is_type('simple') || $product->is_type('external') || $product->is_type('grouped') ) { $regular_price = get_post_meta( $product->get_id(), '_regular_price', true ); $sale_price = get_post_meta( $product->get_id(), '_sale_price', true ); if( !empty($sale_price) ) { echo '