Merge pull request #20021 from woocommerce/fix/19967

Switch stock status when manage stock gets changed and qty is sufficient.
This commit is contained in:
Claudiu Lodromanean 2018-05-09 07:21:59 -07:00 committed by GitHub
commit ec02a133a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1314,7 +1314,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$this->set_stock_status( 'onbackorder' );
// If the stock level is changing and we do now have enough, force in stock status.
} elseif ( $this->get_stock_quantity() > get_option( 'woocommerce_notify_no_stock_amount', 0 ) && array_key_exists( 'stock_quantity', $this->get_changes() ) ) {
} elseif ( $this->get_stock_quantity() > get_option( 'woocommerce_notify_no_stock_amount', 0 ) && ( array_key_exists( 'stock_quantity', $this->get_changes() ) || array_key_exists( 'manage_stock', $this->get_changes() ) ) ) {
$this->set_stock_status( 'instock' );
}
}