From 744549ad13996af04c27a117996d77d1f7afe276 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 24 Sep 2014 11:15:56 +0100 Subject: [PATCH] [2.2] Use variation get_stock_quantity() for max_qty Fixes #6339 --- includes/class-wc-product-variable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-product-variable.php b/includes/class-wc-product-variable.php index 1f6e6998713..1dee8073ddf 100644 --- a/includes/class-wc-product-variable.php +++ b/includes/class-wc-product-variable.php @@ -469,7 +469,7 @@ class WC_Product_Variable extends WC_Product { 'weight' => $variation->get_weight() . ' ' . esc_attr( get_option('woocommerce_weight_unit' ) ), 'dimensions' => $variation->get_dimensions(), 'min_qty' => 1, - 'max_qty' => $variation->backorders_allowed() ? '' : $variation->stock, + 'max_qty' => $variation->backorders_allowed() ? '' : $variation->get_stock_quantity(), 'backorders_allowed' => $variation->backorders_allowed(), 'is_in_stock' => $variation->is_in_stock(), 'is_downloadable' => $variation->is_downloadable() ,