Don't allow PO Box shipping addresses

  • Posts: 3
  • Thank you received: 0
8 years 4 weeks ago #253420

Is there a way to disallow PO Boxes in the shipping address?

Thanks

Jeremy

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 4 weeks ago #253453

Hi,

Yes. You can edit the field "address_street" via the menu Display>Custom fields and use the "regular expression check" setting to forbid the use of PO Boxes.
For example, such regex:

^(?i)(?!p\.?o\.?\sbox|post\soffice).*$
stackoverflow.com/questions/16722720/how-to-negate-po-box-regex

The following user(s) said Thank You: webmaster@pulldog.us

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
8 years 4 weeks ago #253538

Cool thanks.

Is there a way to allow PO Boxes in Billing but not in the Shipping address?

Thanks

Jeremy

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 4 weeks ago #253551

Hi,

There is no option for that for now as you can't have fields for one type of address and not for the other type.
You would have to do the check with custom javascript instead if you wanted to do that, but you would have to ask a developer to do that for you in that case.

The following user(s) said Thank You: webmaster@pulldog.us

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
8 years 3 weeks ago #253880

Thanks for the info.

Jeremy

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum