Show saved message compatibility for t-read website

Show saved message compatibility for t-read website

add_filter('woocommerce_format_sale_price',function($price, $regular_price, $sale_price) {
    
    global $product;
    if (is_object($product)) {
        $discounted_price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', false, $product, 1, 0, 'discounted_price', true, false);
    }

    $sale_html = '<ins>' . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . '</ins>';
	$regular_html = '<del>' . ( is_numeric( $regular_price ) ? wc_price( $regular_price ): $regular_price ) . '</del>';
    
    if($discounted_price !== false) {
        $sale_price = $discounted_price;
    }
    $save_html = '<span class="save">';
    $save_html .= ( is_numeric( $sale_price ) && is_numeric( $regular_price ) ? 'Save&nbsp;' . wc_price( $regular_price - $sale_price ) : '&nbsp;' );
	$save_html .= '</span>';

    $price = $sale_html . $regular_html . $save_html;

    return $price;
}, 100, 3);