Merged in feature/280-dev-dev01 (pull request #21)
auto-patch 280-dev-dev01-2024-01-19T16_41_58 * auto-patch 280-dev-dev01-2024-01-19T16_41_58
This commit is contained in:
@@ -2714,11 +2714,13 @@ class WC_AJAX {
|
||||
$variation = wc_get_product( $variation_id );
|
||||
|
||||
if ( 'false' !== $data['date_from'] ) {
|
||||
$variation->set_date_on_sale_from( wc_clean( $data['date_from'] ) );
|
||||
$date_on_sale_from = date( 'Y-m-d 00:00:00', strtotime( wc_clean( $data['date_from'] ) ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
|
||||
$variation->set_date_on_sale_from( $date_on_sale_from );
|
||||
}
|
||||
|
||||
if ( 'false' !== $data['date_to'] ) {
|
||||
$variation->set_date_on_sale_to( wc_clean( $data['date_to'] ) );
|
||||
$date_on_sale_to = date( 'Y-m-d 23:59:59', strtotime( wc_clean( $data['date_to'] ) ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
|
||||
$variation->set_date_on_sale_to( $date_on_sale_to );
|
||||
}
|
||||
|
||||
$variation->save();
|
||||
|
||||
Reference in New Issue
Block a user