Restrict shopping cart orders using multiples

I am building a distribution management system. There are only a few products that all get shipped on pallets and each pallet is built to include 50 bags. No more, no less. Usually the customer orders a full pallet already set to 50 bags, but we do allow mixed pallets of multiple products as long as they total 50. So, when ordering, I want to make sure that when an order is created, calculated, and paid for, that the bag count on a mixed pallet is equal to 50.

I have created the usual order->shopping cart-> order items database and workflow. The customer can choose a product and enter the number of pallets and the number of bags and add that order item to the shopping cart. The process totals the $ values as the order items are add to the cart. Now I am trying to find a way to set up this kind of restriction for the # of bags when the order is created.

Has anyone done something like this in the past or have a solid example to share on how to accomplish this? Any ideas are also useful to helping me formulate a path. Thanks.

hi, You can implement this restriction by setting up a custom workflow or validation when the customer adds items to the shopping cart. Use a condition to check that the total number of bags across all products in the cart equals 50 for each pallet. If the sum doesn’t equal 50, trigger an alert or prevent the order from being finalized. You can set up a “Total Bags” field in the order items and use it to ensure the total is always 50 before allowing the checkout to proceed. Additionally, you could create custom error messages or prevent the cart from submitting until the condition is met.

This topic was automatically closed after 70 days. New replies are no longer allowed.