WordPress at Your Fingertips
function is not described

WC_AJAX::variation_bulk_action_variable_sale_schedule() private WC 1.0

Bulk action - Sale Schedule.

{} It's a method of the class: WC_AJAX{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_AJAX::variation_bulk_action_variable_sale_schedule( $variations, $data );
$variations(array) (required)
List of variations.
$data(array) (required)
Data to set.

Code of WC_AJAX::variation_bulk_action_variable_sale_schedule() WC 5.9.0

private static function variation_bulk_action_variable_sale_schedule( $variations, $data ) {
	if ( ! isset( $data['date_from'] ) && ! isset( $data['date_to'] ) ) {
		return;
	}

	foreach ( $variations as $variation_id ) {
		$variation = wc_get_product( $variation_id );

		if ( 'false' !== $data['date_from'] ) {
			$variation->set_date_on_sale_from( wc_clean( $data['date_from'] ) );
		}

		if ( 'false' !== $data['date_to'] ) {
			$variation->set_date_on_sale_to( wc_clean( $data['date_to'] ) );
		}

		$variation->save();
	}
}