Esempio n. 1
0
 public function fillAddressFromArray($arr, $address_type = 'shipping')
 {
     if ($address_type == 'billing') {
         $bArr = array();
         foreach ($arr as $key => $field) {
             if (stripos($key, 'billing_') !== false) {
                 $bArr[str_replace('billing_', '', $key)] = $field;
             }
         }
         $arr = $bArr;
     }
     // check for "blank" state
     if ($arr['state_id'] == '0') {
         $arr['state_id'] = '';
     }
     // lowercase country_id.  uppercase values are affecting queries
     $arr['country_id'] = strtolower($arr['country_id']);
     parent::fillFromArray($arr);
     $this->address_type = $address_type;
 }