WordPress at Your Fingertips
function is not described

WC_AJAX::variation_bulk_action_variable_low_stock_amount() private WC 1.0

Bulk action - Set Low Stock Amount.

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

No Hooks.

Return

null. Nothing.

Usage

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

Code of WC_AJAX::variation_bulk_action_variable_low_stock_amount() WC 5.9.0

private static function variation_bulk_action_variable_low_stock_amount( $variations, $data ) {
	if ( ! isset( $data['value'] ) ) {
		return;
	}

	$low_stock_amount = wc_stock_amount( wc_clean( $data['value'] ) );

	foreach ( $variations as $variation_id ) {
		$variation = wc_get_product( $variation_id );
		if ( $variation->managing_stock() ) {
			$variation->set_low_stock_amount( $low_stock_amount );
		} else {
			$variation->set_low_stock_amount( '' );
		}
		$variation->save();
	}
}