Prevent PO Boxes being entered as address at checkout

Anthony_Boyatzi
New Member
1 0 8

I have spent the last few hours reading posts and chatting with Shopify support to find a solution to my problem without success.

I need to prevent customers from entering PO Boxes as their shipping address during the checkout process. I do not want their order cancelled if they happen to enter a PO Box. I would like a message to appear that PO Boxes are not accepted (or a similar message that can be customised). 

I have seen this requested by other Shopify users in the past and yet it is still overlooked or simply ignored.

Surely there should be more customisations available at checkout to ALL Shopify users without having to find a Shopify expert to create an app that doesn't do the job.

Replies 28 (28)
Aline_D
New Member
1 0 0

Hi! Has anyone managed to implement the code provided by Kumar2573 

Thank you! 

Pburt16
Excursionist
10 0 3

No. It's not possible to add code or modify checkout because Shopify does not allow editing access to the checkout.liquid template on any of their plebeian plans—Only Shopify Plus subscribers can modify checkout. 

AOMMedia
New Member
1 0 0

You guys can do it dirty if you require customers to create account profiles in order to purchase/checkout by editing the following page: customers/addresses.liquid 

That page is loaded when a customer is in their registration process for your store. So anyone can script a javascript verification method using <onkeyup=function()> followed by a second verification upon submission of the form during the process.

Good luck.

EHT-dev
Tourist
8 0 0

This scripting solution on /checkout page worked perfectly! Thank you!!

Olop_Ocram
Tourist
11 0 2

We have this script running and it was working perfectly until today.  We had the following address today which was flags as a PO Box:

140 COMPTON DR

The script seems to think it is a PO box address. Does anyone know how to solve this.

 

Mark

 

EHT-dev
Tourist
8 0 0
Had the same issue with a Thompson St address. Seems it’s counting any
character between ‘p’ and ‘o’ and not only a space?
Olop_Ocram
Tourist
11 0 2

Has anyone found a solution to this or does anyone know how to contact Kumar7523?  

Kumar2573
Pathfinder
101 6 12

Hi 

Kindly let us know if you are facing any issues in the P.O box address restication. Can i know you is your store is shopify plus?


Direct Hire Me

Expert Shopify Plus & shopify Developer & Theme customizer
- If the problem is solved remember to click ✅ to Accept Solution
- Press Like ?? if the answer was helpful
- Still, Facing issue, Reach out to me Email :- jitendra3496@gmail.com | Skype :- jitendra2573_1
- Direct Hire me :- Direct Contact me
Olop_Ocram
Tourist
11 0 2

Hi Kumar,

Yes, we are using Shopify Plus.  Your script is wonderful except it seems to have a bug with words that have "p" and "o" with a character in between.  For example, the following street names will show as PO Box with the current code:

125 Compton Ave

200 Thompson St.

It seems the letter in between the "p" and "o" are ignored.