Im trying to set a maximum number of T-Shirts that can be ordered.

This works fine if there is a single attribute, but if I add Colour and Size for example, then the maximum does not work.

I set the maximum to 5

If I try and order 6 t-shirts, small, red then they system correctly says thats above the maximum.

But if I order 5 t-shirts, small, red it will correctly allow me to order.

But it then also allows be to add 5 t-shirts,  medium, red which takes my total order to 10.

Is there any way to set the maximum allows across attributes?

Thanks