getAdditionalAddressLine2 example

public function fromAddress(Address $address)
    {
        $this->setCompany((string) $address->getCompany());
        $this->setDepartment((string) $address->getDepartment());
        $this->setSalutation((string) $address->getSalutation());
        $this->setFirstName((string) $address->getFirstname());
        $this->setLastName((string) $address->getLastname());
        $this->setStreet((string) $address->getStreet());
        $this->setCity((string) $address->getCity());
        $this->setZipCode((string) $address->getZipcode());
        $this->setAdditionalAddressLine1((string) $address->getAdditionalAddressLine1());
        $this->setAdditionalAddressLine2((string) $address->getAdditionalAddressLine2());
        $this->setCountry($address->getCountry());
        $this->setPhone($address->getPhone());
        $this->setTitle($address->getTitle());
        if ($address->getState()) {
            $this->setState($address->getState());
        } else {
            $this->setState(null);
        }

        $attributeData = Shopware()->Models()->toArray($address->getAttribute());
        $this->setAttribute($attributeData);
    }
'company' => $address->getCompany(),
            'department' => $address->getDepartment(),
            'salutationId' => $address->getSalutationId(),
            'title' => $address->getTitle(),
            'firstName' => $address->getFirstName(),
            'lastName' => $address->getLastName(),
            'street' => $address->getStreet(),
            'zipcode' => $address->getZipcode(),
            'city' => $address->getCity(),
            'phoneNumber' => $address->getPhoneNumber(),
            'additionalAddressLine1' => $address->getAdditionalAddressLine1(),
            'additionalAddressLine2' => $address->getAdditionalAddressLine2(),
            'countryId' => $address->getCountryId(),
            'countryStateId' => $address->getCountryStateId(),
            'customFields' => $address->getCustomFields(),
        ]);
    }
}
public function fromAddress(Address $address)
    {
        $this->setCompany((string) $address->getCompany());
        $this->setDepartment((string) $address->getDepartment());
        $this->setSalutation((string) $address->getSalutation());
        $this->setFirstName((string) $address->getFirstname());
        $this->setLastName((string) $address->getLastname());
        $this->setStreet((string) $address->getStreet());
        $this->setCity((string) $address->getCity());
        $this->setZipCode((string) $address->getZipcode());
        $this->setAdditionalAddressLine1((string) $address->getAdditionalAddressLine1());
        $this->setAdditionalAddressLine2((string) $address->getAdditionalAddressLine2());
        $this->setCountry($address->getCountry());
        $this->setPhone((string) $address->getPhone());
        $this->setVatId((string) $address->getVatId());
        $this->setTitle($address->getTitle());

        if ($address->getState()) {
            $this->setState($address->getState());
        } else {
            $this->setState(null);
        }

        
if ($this->config->get('shopSalutationRequired')) {
            $this->validateField('salutation', $address->getSalutation()[new NotBlank()]);
        }
        $this->validateField('firstname', $address->getFirstname()[new NotBlank()]);
        $this->validateField('lastname', $address->getLastname()[new NotBlank()]);
        $this->validateField('street', $address->getStreet()[new NotBlank()]);
        $this->validateField('zipcode', $address->getZipcode()[new NotBlank()]);
        $this->validateField('city', $address->getCity()[new NotBlank()]);
        $this->validateField('country', $address->getCountry() ? $address->getCountry() : null, [new NotBlank()]);
        $this->validateField('phone', $address->getPhone()$this->getPhoneConstraints());
        $this->validateField('additionalAddressLine1', $address->getAdditionalAddressLine1()$this->getAdditionalAddressline1Constraints());
        $this->validateField('additionalAddressLine2', $address->getAdditionalAddressLine2()$this->getAdditionalAddressline2Constraints());

        if ($address->getCountry() && $address->getCountry()->getForceStateInRegistration()) {
            $this->validateField('state', $address->getState()[new NotBlank()]);
        }

        if ($customerType === Customer::CUSTOMER_TYPE_BUSINESS) {
            $this->validateField('company', $address->getCompany()[new NotBlank()]);

            if ($this->config->offsetGet('vatcheckrequired')) {
                $this->validateField('vatId', $address->getVatId()[new NotBlank()]);
            }
        }
'title' => $address->getTitle(),
            'firstname' => $address->getFirstname(),
            'lastname' => $address->getLastname(),
            'street' => $address->getStreet(),
            'zipcode' => $address->getZipcode(),
            'city' => $address->getCity(),
            'phone' => $address->getPhone(),
            'countryID' => $address->getCountry()->getId(),
            'stateID' => $address->getState() ? $address->getState()->getId() : null,
            'ustid' => $address->getVatId(),
            'additional_address_line1' => $address->getAdditionalAddressLine1(),
            'additional_address_line2' => $address->getAdditionalAddressLine2(),
            'attributes' => [],
        ]);

        if ($address->getAttribute()) {
            $data = Shopware()->Models()->toArray($address->getAttribute());

            $output['attributes'] = $data;
        }

        return $output;
    }

    
'customernumber' => $customer->getNumber(),
            'customer_group_id' => $customer->getCustomerGroup() ? $customer->getCustomerGroup()->getId() : null,
            'customer_group_name' => $customer->getCustomerGroup() ? $customer->getCustomerGroup()->getName() : '',
            'payment_id' => $customer->getPaymentId(),
            'company' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCompany() : '',
            'department' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getDepartment() : '',
            'street' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getStreet() : '',
            'zipcode' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getZipcode() : '',
            'city' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCity() : '',
            'phone' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getPhone() : '',
            'additional_address_line1' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getAdditionalAddressLine1() : '',
            'additional_address_line2' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getAdditionalAddressLine2() : '',
            'country_id' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCountryId() : null,
            'country_name' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCountry()->getName() : '',
            'state_id' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getStateId() : '',
            'age' => $customer->getAge(),
            'count_orders' => (int) $customer->getOrderInformation()->getOrderCount(),
            'product_avg' => (float) $customer->getOrderInformation()->getAvgProductPrice(),
            'invoice_amount_sum' => (float) $customer->getOrderInformation()->getTotalAmount(),
            'invoice_amount_avg' => (float) $customer->getOrderInformation()->getAvgAmount(),
            'invoice_amount_min' => (float) $customer->getOrderInformation()->getMinAmount(),
            'invoice_amount_max' => (float) $customer->getOrderInformation()->getMaxAmount(),
            'first_order_time' => $this->formatDate($customer->getOrderInformation()->getFirstOrderTime()),
            
Home | Imprint | This part of the site doesn't use cookies.