Bulk update variation: Allow stock to be set to 0.
This commit is contained in:
parent
bbb00d9a3a
commit
07b1f9329d
|
@ -2760,13 +2760,12 @@ class WC_AJAX {
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*/
|
*/
|
||||||
private static function variation_bulk_action_variable_stock( $variations, $data ) {
|
private static function variation_bulk_action_variable_stock( $variations, $data ) {
|
||||||
if ( empty( $data['value'] ) ) {
|
if ( ! isset( $data['value'] ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = wc_clean( $data['value'] );
|
$value = wc_clean( $data['value'] );
|
||||||
|
|
||||||
if ( $value ) {
|
|
||||||
foreach ( $variations as $variation_id ) {
|
foreach ( $variations as $variation_id ) {
|
||||||
if ( 'yes' === get_post_meta( $variation_id, '_manage_stock', true ) ) {
|
if ( 'yes' === get_post_meta( $variation_id, '_manage_stock', true ) ) {
|
||||||
wc_update_product_stock( $variation_id, wc_stock_amount( $value ) );
|
wc_update_product_stock( $variation_id, wc_stock_amount( $value ) );
|
||||||
|
@ -2775,7 +2774,6 @@ class WC_AJAX {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk action - Set Weight
|
* Bulk action - Set Weight
|
||||||
|
|
|
@ -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 - Subscriptions 2.0 (unreleased) compatibility.
|
||||||
* Fix - Added BW compatibility for themes using 'uniform'.
|
* Fix - Added BW compatibility for themes using 'uniform'.
|
||||||
* Fix - Encode variation data in add_to_cart_url method.
|
* 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 - Add tooltips for tax status and tax class options.
|
||||||
* Tweak - WC Setup wizard: multi-line step styling.
|
* Tweak - WC Setup wizard: multi-line step styling.
|
||||||
* Tweak - WC Setup wizard: site icon display on WP 4.3.
|
* Tweak - WC Setup wizard: site icon display on WP 4.3.
|
||||||
|
|
Loading…
Reference in New Issue