Currently if “Set maximum parameter based on “Per product” maximum limits” is unticked, the user can attempt to add as many to their cart as is in stock before being shown an error saying the maximum purchase limit, if it is ticked then the user can attempt to add the maximum set quantity to cart even if there is less in stock, and will also be shown an error saying how many is in stock.
This results in two needless errors whether the option is ticked or unticked which is a poor user experience and I would like to propose a solution.
When “Set maximum parameter based on “Per product” maximum limits” is ticked, the logic should be secondary to available stock (if stock is set by managed quantity).
Example: I set a limit of 5 per product and 3 are in stock, the customer can only add 3 to their cart, if there is 7 in stock, the customer can add the set maximum of 5.
I hope this helps improve the plugin and customers experience.