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:
Tony Volpe
2024-01-19 16:44:43 +00:00
parent 2699b5437a
commit be83910651
2125 changed files with 179300 additions and 35639 deletions

View File

@@ -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();