Fix bulk stock editing. Closes #1624.

This commit is contained in:
Mike Jolley 2012-11-06 13:54:57 +00:00
parent 7becdf346c
commit 94de5c329f
2 changed files with 10 additions and 6 deletions

View File

@ -1129,19 +1129,22 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
// Handle stock
if ( ! $product->is_type( 'grouped' ) ) {
if ( ! empty( $_REQUEST['change_stock'] ) ) {
update_post_meta( $post_id, '_stock', (int) $_REQUEST['_stock'] );
update_post_meta( $post_id, '_manage_stock', 'yes' );
}
if ( ! empty( $_REQUEST['_manage_stock'] ) ) {
if ( $_REQUEST['_manage_stock'] == 'yes' ) {
update_post_meta( $post_id, '_manage_stock', 'yes' );
if ( ! empty( $_REQUEST['change_stock'] ) )
update_post_meta( $post_id, '_stock', (int) $_REQUEST['_stock'] );
update_post_meta( $post_id, '_manage_stock', 'yes' );
} else {
update_post_meta( $post_id, '_manage_stock', 'no' );
update_post_meta( $post_id, '_stock', '0' );
}
}
}
// Clear transient

View File

@ -4,7 +4,7 @@ Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, affiliate
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@woothemes.com&item_name=Donation+for+WooCommerce
Requires at least: 3.3
Tested up to: 3.4.2
Stable tag: 1.6.5.1
Stable tag: 1.6.5.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -207,6 +207,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - Coupon description field.
* Tweak - Exclude up-sells from related products.
* Tweak - Allowed sku search to return > 1 result.
* Tweak - If only one country is enabled, don't show country dropdown on checkout.
* Fix - Added more error messages for coupons.
* Fix - Variation sku updating after selection.