[2.5] Clear sale price on save if sale is no longer valid.

Closes #10454
This commit is contained in:
Mike Jolley 2016-03-03 13:16:20 +00:00
parent c21b0eda82
commit 89e8404acb
1 changed files with 1 additions and 0 deletions

View File

@ -1012,6 +1012,7 @@ class WC_Meta_Box_Product_Data {
if ( $date_to && strtotime( $date_to ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
update_post_meta( $post_id, '_price', '' === $regular_price ? '' : wc_format_decimal( $regular_price ) );
update_post_meta( $post_id, '_sale_price', '' );
update_post_meta( $post_id, '_sale_price_dates_from', '' );
update_post_meta( $post_id, '_sale_price_dates_to', '' );
}