Do customers miss your "We can't ship to PO Boxes" message? You can now prevent them from placing the order...
You'll also need to prefix the above expression with a check for null, because during a Shipping Estimate (as opposed to checkout), there is no Address1. So, the final expression looks like this:
ShippingAddress.Address1 != null and Regex.IsMatch(ShippingAddress.Address1, "(?i)\b(?:Post\ (?:Office\ )?|P[.\ ]?O\.?\ )?Box\b")
We recently enabled Guest Checkout on our nopcommerce 3.20 site and it seems that occasionally an order will make it through the system without an email, throwing an error in our admin area.
I'm wondering if there is such a variable as "ShippingAddress.Email" that I could write an ErrorExit for?
ErrorExit EmailRequired String.IsNullOrWhiteSpace(ShippingAddress.Email) "Email is required"
However, it should never happen... Email is a required field on the checkout address page.
Just follow the ErrorExit with another rule using Option or OptionExit to call other shipping rate providers - e.g.
Option Shipping true Shipping.FixedOrByWeight