[2.2] Use variation get_stock_quantity() for max_qty

Fixes #6339