public function getDeliveryFields()
    {
        $contact = $this->getContact();

        $fields = FieldList::create(
            CompositeField::create(
                CompositeField::create(
                    TextField::create(
                        'DeliveryCompany',
                        _t('SilverCommerce\Checkout.Company', 'Company')
                    )->setRightTitle(_t(
                        "SilverCommerce\Checkout.Optional",
                        "Optional"
                    )),
                    TextField::create(
                        'DeliveryFirstName',
                        _t('SilverCommerce\Checkout.FirstName', 'First Name(s)')
                    ),
                    TextField::create(
                        'DeliverySurname',
                        _t('SilverCommerce\Checkout.Surname', 'Surname')
                    )
                )->setName("PersonalFields"),

                $address_fields = CompositeField::create(
                    TextField::create(
                        'DeliveryAddress1',
                        _t('SilverCommerce\Checkout.Address1', 'Address Line 1')
                    ),
                    TextField::create(
                        'DeliveryAddress2',
                        _t('SilverCommerce\Checkout.Address2', 'Address Line 2')
                    )->setRightTitle(_t("SilverCommerce\Checkout.Optional", "Optional")),
                    TextField::create(
                        'DeliveryCity',
                        _t('SilverCommerce\Checkout.City', 'City')
                    ),
                    DropdownField::create(
                        'DeliveryCountry',
                        _t('SilverCommerce\Checkout.Country', 'Country'),
                        i18n::getData()->getCountries(),
                        Locale::getRegion(i18n::get_locale())
                    ),
                    RegionSelectionField::create(
                        "DeliveryCounty",
                        _t('SilverCommerce\Checkout.Region', "County/State"),
                        "DeliveryCountry"
                    ),
                    TextField::create(
                        'DeliveryPostCode',
                        _t('SilverCommerce\Checkout.PostCode', 'Post Code')
                    )
                )->setName("AddressFields")
            )->setName("DeliveryFields")
            ->setColumnCount(2)
        );

        // Add a save address for later checkbox if a user is logged in
        if ($contact) {
            $address_fields->push(CheckboxField::create(
                "SaveShippingAddress",
                _t('SilverCommerce\Checkout.SaveAddress', 'Save Address')
            ));
        }

        if ($contact && $contact->Locations()->count() > 1) {
            $address_fields->push(FormAction::create(
                'doUseSavedShipping',
                _t(
                    'SilverCommerce\Checkout.UseSavedAddress',
                    'Use Saved Address'
                )
            )->addextraClass('btn btn-link')
            ->setAttribute('formnovalidate',true));
        }

        return $fields;
    }
public function getDeliveryFields()
    {
        $contact = $this->getContact();

        $fields = FieldList::create(
            CompositeField::create(
                CompositeField::create(
                    TextField::create(
                        'DeliveryCompany',
                        _t('SilverCommerce\Checkout.Company', 'Company')
                    )->setRightTitle(_t(
                        "SilverCommerce\Checkout.Optional",
                        "Optional"
                    )),
                    TextField::create(
                        'DeliveryFirstName',
                        _t('SilverCommerce\Checkout.FirstName', 'First Name(s)')
                    ),
                    TextField::create(
                        'DeliverySurname',
                        _t('SilverCommerce\Checkout.Surname', 'Surname')
                    )
                )->setName("PersonalFields"),

                $address_fields = CompositeField::create(
                    TextField::create(
                        'DeliveryAddress1',
                        _t('SilverCommerce\Checkout.Address1', 'Address Line 1')
                    ),
                    TextField::create(
                        'DeliveryAddress2',
                        _t('SilverCommerce\Checkout.Address2', 'Address Line 2')
                    )->setRightTitle(_t("SilverCommerce\Checkout.Optional", "Optional")),
                    TextField::create(
                        'DeliveryCity',
                        _t('SilverCommerce\Checkout.City', 'City')
                    ),
                    DropdownField::create(
                        'DeliveryCountry',
                        _t('SilverCommerce\Checkout.Country', 'Country'),
                        i18n::getData()->getCountries(),
                        Locale::getRegion(i18n::get_locale())
                    ),
                    RegionSelectionField::create(
                        "DeliveryCounty",
                        _t('SilverCommerce\Checkout.Region', "County/State"),
                        "DeliveryCountry"
                    ),
                    TextField::create(
                        'DeliveryPostCode',
                        _t('SilverCommerce\Checkout.PostCode', 'Post Code')
                    )
                )->setName("AddressFields")
            )->setName("DeliveryFields")
            ->setColumnCount(2)
        );

        // Add a save address for later checkbox if a user is logged in
        if ($contact) {
            $address_fields->push(CheckboxField::create(
                "SaveShippingAddress",
                _t('SilverCommerce\Checkout.SaveAddress', 'Save Address')
            ));
        }

        if ($contact && $contact->Locations()->count() > 1) {
            $address_fields->push(FormAction::create(
                'doUseSavedShipping',
                _t(
                    'SilverCommerce\Checkout.UseSavedAddress',
                    'Use Saved Address'
                )
            )->addextraClass('btn btn-link')
            ->setAttribute('formnovalidate',true));
        }

        return $fields;
    }
public function getDeliveryFields ( ) { $ contact = $ this -> getContact ( ) ; $ fields = FieldList :: create ( CompositeField :: create ( CompositeField :: create ( TextField :: create ( 'DeliveryCompany' , _t ( 'SilverCommerce\Checkout.Company' , 'Company' ) ) -> setRightTitle ( _t ( "SilverCommerce\Checkout.Optional" , "Optional" ) ) , TextField :: create ( 'DeliveryFirstName' , _t ( 'SilverCommerce\Checkout.FirstName' , 'First Name(s)' ) ) , TextField :: create ( 'DeliverySurname' , _t ( 'SilverCommerce\Checkout.Surname' , 'Surname' ) ) ) -> setName ( "PersonalFields" ) , $ address_fields = CompositeField :: create ( TextField :: create ( 'DeliveryAddress1' , _t ( 'SilverCommerce\Checkout.Address1' , 'Address Line 1' ) ) , TextField :: create ( 'DeliveryAddress2' , _t ( 'SilverCommerce\Checkout.Address2' , 'Address Line 2' ) ) -> setRightTitle ( _t ( "SilverCommerce\Checkout.Optional" , "Optional" ) ) , TextField :: create ( 'DeliveryCity' , _t ( 'SilverCommerce\Checkout.City' , 'City' ) ) , DropdownField :: create ( 'DeliveryCountry' , _t ( 'SilverCommerce\Checkout.Country' , 'Country' ) , i18n :: getData ( ) -> getCountries ( ) , Locale :: getRegion ( i18n :: get_locale ( ) ) ) , RegionSelectionField :: create ( "DeliveryCounty" , _t ( 'SilverCommerce\Checkout.Region' , "County/State" ) , "DeliveryCountry" ) , TextField :: create ( 'DeliveryPostCode' , _t ( 'SilverCommerce\Checkout.PostCode' , 'Post Code' ) ) ) -> setName ( "AddressFields" ) ) -> setName ( "DeliveryFields" ) -> setColumnCount ( 2 ) ) ; // Add a save address for later checkbox if a user is logged in if ( $ contact ) { $ address_fields -> push ( CheckboxField :: create ( "SaveShippingAddress" , _t ( 'SilverCommerce\Checkout.SaveAddress' , 'Save Address' ) ) ) ; } if ( $ contact && $ contact -> Locations ( ) -> count ( ) > 1 ) { $ address_fields -> push ( FormAction :: create ( 'doUseSavedShipping' , _t ( 'SilverCommerce\Checkout.UseSavedAddress' , 'Use Saved Address' ) ) -> addextraClass ( 'btn btn-link' ) -> setAttribute ( 'formnovalidate' , true ) ) ; } return $ fields ; }
Generate a FieldList of delivery address fields

@return FieldList
Generate a FieldList of delivery address fields