Have someone successfully implemented even mutiple...
# suitecommerce
m
Have someone successfully implemented even mutiples in SuiteCommerce? E.g a customer can only buy 25, 50, 75, 100 pcs or 5, 10, 15, 20 pcs of each item. It's a too big project for the customer to start using real unit conversion and the above would solve a lot of there headaches.
s
This should be a fairly straight-forward extension to write I think
• The input should be modified so that it uses the
step
attribute (eg
step="5"
). This naturally forces validation/increases of 5. • beforeAddToCart should have a listener put on it that validates the value and returns an error if it's not a multiple of 5 • Additional text should be added just above the input to say that it should be multiples 5 • If you want to go even further, you can add validation on the server side to prevent orders for lines that aren't the right multiples
m
Thank you @Steve Goldberg