diff --git a/woocommerce-max-quantity.php b/woocommerce-max-quantity.php index c7fb6e2..90de672 100755 --- a/woocommerce-max-quantity.php +++ b/woocommerce-max-quantity.php @@ -156,7 +156,7 @@ function isa_wc_max_qty_variation_input_qty_max( $args, $product, $variation ) { // Limit our max by the available stock, if stock is lower // Set to lessor of stock qty or max allowed - $args['max_qty'] = min( $qty, $args['max_qty'] ); + $args['max_qty'] = min( $max, $args['max_qty'] ); }