Merge pull request #11932 from franticpsyx/fix-variation-on-backorder-with-parent-managing-stock

[2.6] Variation is_on_backorder fails when parent manages stock and child doesn't...
This commit is contained in:
Justin Shreve 2016-09-29 15:51:45 -07:00 committed by GitHub
commit 1fbc48abeb
1 changed files with 1 additions and 1 deletions

View File

@ -561,7 +561,7 @@ class WC_Product_Variation extends WC_Product {
if ( true === $this->managing_stock() ) {
return parent::is_on_backorder( $qty_in_cart );
} else {
return $this->parent->is_on_backorder( $qty_in_cart );
return $this->parent->managing_stock() && $this->parent->backorders_allowed() && ( $this->parent->get_stock_quantity() - $qty_in_cart ) < 0;
}
}