×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: bejoy balan
Added: Feb 24, 2016 10:02 AM
Views: 1959
Tags: box po pregmatch
  1.  if($this->getAddressType() == 'shipping') {
  2.                         if (preg_match("/(^|\s+)p\.?\s*o\.?\s*box(\s+|\d+|$)/i", $this->getStreet(1))) {
  3.                                 $errors[] = $helper->__('We cannot ship to PO boxes.');
  4.                         }
  5.                 }