[2.2] Use variation get_stock_quantity() for max_qty

Fixes #6339
This commit is contained in:
Mike Jolley 2014-09-24 11:15:56 +01:00
parent b8bcb5ee6e
commit 744549ad13
1 changed files with 1 additions and 1 deletions

View File

@ -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() ,