For large $ orders, it may be desirable to enforce that the shipping address is the same as the billing address. Use an ErrorExit to check it:
Type: | ErrorExit |
Name: | Billing & Shipping must be same over X |
Expression: | ShippingAddress.Address1 != null and [$SubTotalWithDiscounts] > 300 and Customer.ShippingAddress.Id != Customer.BillingAddress.Id |
Description Expression: | "Sorry, for orders over $300 the shipping address must be the same as the billing address" |
In the Expression, the term "ShippingAddress.Address1 != null" checks to see that we are not in "Estimate Shipping". The Customer object is used by nopC to "save" the addresses selected during checkout.
P.S. The match above is done with the Address.Id . That means it's the exact same address record. If the customer may have entered two different address records with the same Street/City/Zip, then you can adjust the above to check the individual fields instead - e.g.
!(Customer.ShippingAddress.Address1 = Customer.BillingAddress.Address1 and Customer.ShippingAddress.ZipPostalCode = Customer.BillingAddress.ZipPostalCode)