Prevent checkout if the cart has products that don't all have the same vendor

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"

Tags :  VendorErrorExit
Comments
Leave your comment
:
sample@email.tst
Created on: 6/26/2023 5:31 PM
1
sample@email.tst
Created on: 6/26/2023 5:31 PM
1