daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 143 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  /** @var Mage_Sales_Model_Quote_Address $billingAddress */
  2.             $address = $quote->getBillingAddress();
  3.             if ($address) {
  4.  
  5.                 $result['email'] = trim($address->getEmail());
  6.                 $result['postal_code'] = trim($address->getPostcode());
  7.                 if (!strlen($result['postal_code'])) {
  8.                     $result['postal_code'] = '12345';
  9.                 }
  10.                 if (!strlen($result['email'])) {
  11.                     $result['email'] = 'your@email.com';
  12.                 }
  13.                 $tmp = '';
  14.                 if ( preg_match('/^([^\d]*[^\d\s]) *(\d.*)$/', $address->getStreet(1), $tmp) ) {
  15.                     $streetName = $tmp[1];
  16.                     $streetNumber = $tmp[2];
  17.                     if (strlen($streetName)) {
  18.                         $result['street_name'] = $streetName;
  19.                     }
  20.                     if (strlen($streetNumber)) {
  21.                         $result['street_number'] = $streetNumber;
  22.                     }
  23.                 }
  24.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top