Prevent checkout if the cart has products that don't all have the same vendor
Thursday, October 1, 2015
There are a few blogs that show how to use ErrorExit to prevent the customer from checking out; like this one.
Here's how to prevent checkout if the cart has products that don't all have the same vendor:
ErrorExit Items.Select(Product.VendorId).Distinct().Count() > 1 "Your cart contains products that don't all have the same vendor"