Display Sale Date from and Sale Date to
<p>I got this code from here ( <a href="https://stackoverflow.com/questions/23329518/display-woocommerce-sale-end-date">Display woocommerce sale end date</a> )</p>

<pre><code>add_filter( 'woocommerce_get_price_html', 'custom_price_html', 100, 2 );
function custom_price_html( $price, $product )
{
    global $post;
    $sales_price_to = get_post_meta($post-&gt;ID, '_sale_price_dates_to', true);
    if(is_single() &amp;&amp; $sales_price_to != "")
    {
        $sales_price_date_to = date("j M y", $sales_price_to);
        return str_replace( '&lt;/ins&gt;', ' &lt;/ins&gt; &lt;b&gt;(Offer till '.$sales_price_date_to.')&lt;/b&gt;', $price );
    }
    else
    {
        return apply_filters( 'woocommerce_get_price', $price );
    }
}
</code></pre>

<p>This only displays the Sale Date to. How do I make it display the sale date from till sale date to?</p>

<p>I tried editing this line:</p>

<pre><code>return str_replace( '&lt;/ins&gt;', ' &lt;/ins&gt; &lt;b&gt;(Offer till '.$sales_price_date_to.')&lt;/b&gt;', $price );
</code></pre>

<p>to</p>

<pre><code>return str_replace( '&lt;/ins&gt;', ' &lt;/ins&gt; &lt;b&gt;(Offer from '.$sales_price_date_from.' till '.$sales_price_date_to.')&lt;/b&gt;', $price );
</code></pre>

<p>but it doesn't display the sale date from.</p>

<p>So can someone please tell me how I display both the sale date from and sale date to?</p>