improved handling of stock options to save changes to a variable product

This commit is contained in:
claudiosmweb 2014-08-04 14:53:29 -03:00
parent 928e4ae4c0
commit bce502f455
1 changed files with 5 additions and 4 deletions

View File

@ -1450,10 +1450,11 @@ class WC_Meta_Box_Product_Data {
$variation_id = absint( $variable_post_id[ $i ] );
// Checkboxes
$is_virtual = isset( $variable_is_virtual[ $i ] ) ? 'yes' : 'no';
$is_downloadable = isset( $variable_is_downloadable[ $i ] ) ? 'yes' : 'no';
$post_status = isset( $variable_enabled[ $i ] ) ? 'publish' : 'private';
$manage_stock = isset( $variable_manage_stock[ $i ] ) ? 'yes' : 'no';
$is_virtual = isset( $variable_is_virtual[ $i ] ) ? 'yes' : 'no';
$is_downloadable = isset( $variable_is_downloadable[ $i ] ) ? 'yes' : 'no';
$post_status = isset( $variable_enabled[ $i ] ) ? 'publish' : 'private';
$parent_manage_stock = isset( $_POST['_manage_stock'] ) ? 'yes' : 'no';
$manage_stock = ( isset( $variable_manage_stock[ $i ] ) && 'yes' == $parent_manage_stock ) ? 'yes' : 'no';
// Generate a useful post title
$variation_post_title = sprintf( __( 'Variation #%s of %s', 'woocommerce' ), absint( $variation_id ), esc_html( get_the_title( $post_id ) ) );