From 55f4a846db24501e70360597081e6bc2b9153e97 Mon Sep 17 00:00:00 2001 From: Manos Psychogyiopoulos Date: Thu, 15 Sep 2016 22:56:33 +0300 Subject: [PATCH] fix variation is_on_backorder when parent manages stock --- includes/class-wc-product-variation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-product-variation.php b/includes/class-wc-product-variation.php index 05ca5347f2a..c9e1152a055 100644 --- a/includes/class-wc-product-variation.php +++ b/includes/class-wc-product-variation.php @@ -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; } }