Pop\Shipping\Adapter\Ups::shipTo PHP Метод

shipTo() публичный Метод

Set ship to
public shipTo ( array $shipTo ) : void
$shipTo array
Результат void
    public function shipTo(array $shipTo)
    {
        foreach ($shipTo as $key => $value) {
            if (stripos($key, 'company') !== false) {
                $this->shipTo['CompanyName'] = $value;
            } else {
                if (strtolower($key) == 'addressline1' || strtolower($key) == 'address1' || strtolower($key) == 'address') {
                    $this->shipTo['AddressLine1'] = $value;
                } else {
                    if (strtolower($key) == 'addressline2' || strtolower($key) == 'address2') {
                        $this->shipTo['AddressLine2'] = $value;
                    } else {
                        if (strtolower($key) == 'addressline3' || strtolower($key) == 'address3') {
                            $this->shipTo['AddressLine3'] = $value;
                        } else {
                            if (strtolower($key) == 'city') {
                                $this->shipTo['City'] = $value;
                            } else {
                                if (strtolower($key) == 'postalcode' || strtolower($key) == 'zipcode' || strtolower($key) == 'zip') {
                                    $this->shipTo['PostalCode'] = $value;
                                } else {
                                    if (strtolower($key) == 'countrycode' || strtolower($key) == 'country') {
                                        $this->shipTo['CountryCode'] = $value;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }