Sorry, we can't ship to PO Boxes

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")

Tags :  PO-Boxes
Leave your comment
Created on: 2/27/2014 5:15 PM
Howdy again-

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?
Created on: 2/27/2014 10:21 PM
Yes, you can use ShippingAddress.Email - e.g.

ErrorExit    EmailRequired   String.IsNullOrWhiteSpace(ShippingAddress.Email)     "Email is required"

However, it should never happen...  Email is a required field on the checkout address page.