Hello Matt,
As I wrote in the ticket (we can optionally continue there and then add the conclusions here for anyone interested), the check for validity of the cart content (and met conditions) is done by
ShoppingCartInfoProvider.CheckShoppingCart method and the result is then displayed in the error message (if there's any error).
This code is in the
ProcessStep and
OnPreRender (I forgot about that one in the ticket, sorry) methods in
~\CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCartContent.ascx.cs
step control code, so you could modify it and add some automatic removal of the item that failed the check, or change the quantity to meet the condition. The first method is run when you proceed to checkout, the second one is run when the shopping cart is being prepared for rendering.
The checked items with the check results are in the
ItemResults property of the
ShoppingCartCheckResult checkResult,
Individual items - objects of type
ShoppingCartItemCheckResult have the
MaxUnitsExceeded or
MinUnitsNotReached property, which is true in case of the unit count limit conditions are not met.
Either way, the control won't allow you to continue. If you have the problem with this behavior, you can change that as I'm writing above.
This is currently the default behavior. The advantage for the customer is that he sees what's the limit. If there was any automatic update of the value, the customer might be confused what's happening, if you didn't inform him about that limit.
Furthermore, you could customize the
ShoppingCartItemSelector control so that it would limit the units input textbox to the specified interval for the product. This is what you have probably made ("I figured out how to...").
The only problem with this solution is that it may need to perform additional queries for data, thus creating more load (on server resources).
Please feel free to contact us if you have any additional questions.
Regards,
Zdenek