fix variation is_on_backorder when parent manages stock

This commit is contained in:
Manos Psychogyiopoulos 2016-09-15 22:56:33 +03:00
parent 0eb1c4f846
commit 55f4a846db
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;
}
}