I found this thread in wordpress
http://wordpress.org/support/topic/get-woocommerce-scheduled-sale-end-date?replies=15
but when I tried it, it did not work. Perhaps because the answer was too old.
Anyone knows how to get end date of scheduled sale woocommerce product?
This is what I have so far
$sale_price_dates_to = ( $date = get_post_meta( $thepostid, '_sale_price_dates_to', true ) ) ? date_i18n( 'Y-m-d', $date ) : '';
echo $sale_price_dates_to;
it returns
string(0) ""
Thanks
An example on this page, details how it can be done:
Add the following to the
functions.php
fileI have tried it on my website and it works for me.
This works for me 🙂