Bulk update variation: Allow stock to be set to 0.

This commit is contained in:
Mike Jolley 2015-08-21 16:48:25 +01:00
parent bbb00d9a3a
commit 07b1f9329d
2 changed files with 8 additions and 9 deletions

View File

@ -2760,13 +2760,12 @@ class WC_AJAX {
* @param array $data
*/
private static function variation_bulk_action_variable_stock( $variations, $data ) {
if ( empty( $data['value'] ) ) {
if ( ! isset( $data['value'] ) ) {
return;
}
$value = wc_clean( $data['value'] );
if ( $value ) {
foreach ( $variations as $variation_id ) {
if ( 'yes' === get_post_meta( $variation_id, '_manage_stock', true ) ) {
wc_update_product_stock( $variation_id, wc_stock_amount( $value ) );
@ -2775,7 +2774,6 @@ class WC_AJAX {
}
}
}
}
/**
* Bulk action - Set Weight

View File

@ -164,7 +164,8 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Subscriptions 2.0 (unreleased) compatibility.
* Fix - Added BW compatibility for themes using 'uniform'.
* Fix - Encode variation data in add_to_cart_url method.
* Fix - Bulk update variation manage stock when _manage_stock meta data is missing.
* Fix - Bulk update variation: Set manage stock when _manage_stock meta data is missing.
* Fix - Bulk update variation: Allow stock to be set to 0.
* Tweak - Add tooltips for tax status and tax class options.
* Tweak - WC Setup wizard: multi-line step styling.
* Tweak - WC Setup wizard: site icon display on WP 4.3.