Loading...
Skip navigation
Please note that this documentation is for the most recent version of this extension. It may not be relevant for older versions. Related documentation can be found in the documentation directory of the extension.

Field definitions

Fields for checkout can be defined like described on this page. Basically you define a set of fields and assign it afterwards to your different checkouts. In that way you're able to have different fields on each checkout type.

All field definitions must be inserted in plugin.tx_shop.settings.basketOrder.fieldDefinition in which the key acts as the internal field name.

AttributeDescription
labelLabel for the field. It supports a and spanHTML tags for style manipulation and checkbox links.
placeholderPlaceholder text for input fields.
typePossible types: input as a simple text input, country as a country select-box, textarea as a multiline textarea, checkbox as a simple checkbox, select as a select box.
evalFor example trim on type=input for removing spaces before/after, email on type=input for validating an email, phone on type=input for validating a phone number.
defaultDefines a default value which will be inserted on first load of the form. This is useful for example for selecting the DE country in the country selection by default.
optionsDefines the options for the select box, like: options.0.value = male for the select box option value of the first item and options.0.label = Male for the label - see example below.
linkPidOnly for checkboxes. Can contain a page uid for inserting a link for example to terms or privacy. For this the label must contain a %s - for example I've read the <a href="%s" target="_blank">privacy protection and accept them</a>. A value could be a TypoScript constant as well {$themes.configuration.pages.terms}
errorsContains one or more validations.
errors.isEmptyValidator which requires text in an input. The value must contain the error message.
errors.isInvalidEmailValidator which requires a valid email address in an input. The value must contain the error message.
errors.userWithEmailAlreadyExistsValidator which checks if there ist already a user in database with this email address. The value must contain the error message.
deliveryAddressToggleThis attribute defines the divergent delivery address checkbox. It must be simply set to deliveryAddressToggle = 1.
deliveryAddressThis attribute defines that a field belongs to the divergent delivery address. All fields with deliveryAddress = 1 will be toggled by the deliveryAddressToggle checkbox.
fetchFromThis attribute defines that this field must be automatically filled. The value delivery_address.company forces, that from the giving delivery_address, which is a tx_modules_domain_model_address, the field company will be written in this checkout-field.

The predefined fields can be added to the checkout like this:

plugin.tx_shop.settings.basketOrder {
    orderOptions {
        onInvoice {
            fields {
                available = firstname, lastname, street, houseNumber, postalCode, city, country, phone, email, termsConfirmed
                required = firstname, lastname, country, phone, email, termsConfirmed
            }
        }
    }
}

avaiable defines the fields which are visible and required the fields which are mandatory.

Attention:

Depending on Payment type different fields must be required - for example the country.

Attention:

If fields are changed during development, they may be temporarily saved in the session. Therefore, it's a good idea to delete the frontend session cookie if fields or configuration for the checkout have been changed!

Already predefined fields

plugin.tx_shop.settings.basketOrder {
    fieldDefinition {
        company {
            label = Company
            placeholder = Your company
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your company name
            }
        }
        vatId {
            label = VAT-ID
            placeholder = Your VAT-ID
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your VAT-ID
            }
        }
        gender {
            label = Gender
            type = select
            eval = trim
            options {
                0 {
                    value = male
                    label = Male
                }
                1 {
                    value = female
                    label = Female
                }
                2 {
                    value = other
                    label = Other
                }
            }
        }
        firstname {
            label = Firstname
            placeholder = Your firstname
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your firstname
            }
        }
        lastname {
            label = Lastname
            placeholder = Your lastname
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your lastname
            }
        }
        address {
            label = Address
            placeholder = Your Address
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your address
            }
        }
        street {
            label = Street
            placeholder = Your street
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your street
            }
        }
        houseNumber {
            label = Housenumber
            type = input
            eval = trim
            placeholder = Your housenumber
            errors {
                isEmpty = Please enter your housenumber
            }
        }
        postalCode {
            label = Postal code
            placeholder = Your postal code
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your postal code
            }
        }
        city {
            label = City
            placeholder = Your city
            type = input
            eval = trim
            errors {
                isEmpty = Please enter your city
            }
        }
        country {
            label = Land
            type = country
            eval = trim
            default = DE
            errors {
                isEmpty = Please choose your country
            }
        }
        phone {
            label = Phone
            placeholder = Your phone number
            type = input
            eval = trim,phone
            errors {
                isEmpty = Please enter your phone number
                isInvalidPhone = Please enter a valid phone number
            }
        }
        password {
            label = Password
            placeholder = Your password
            type = password
            eval = trim,password
            passwordCompare {
                label = Repeat password
                placeholder = Repeat your password
            }
            errors {
                isEmpty = Please enter your password
                isInvalidPassword = Please enter a valid password with at least 10 characters, one upper and lower case character, one number and a special character.
                unequalPasswords = Given passwords aren't equal
            }
        }
        email {
            label = Email
            placeholder = Your email
            type = input
            eval = trim,email
            emailCompare {
                active = {$themes.configuration.extension.shop.checkout.emailCompare}
                label = Repeat email
                placeholder = Repeat your email
            }
            errors {
                isEmpty = Please enter your email address
                isInvalidEmail = Please enter a valid mail address
                unequalMails = Given mail addresses aren't equal
                userWithEmailAlreadyExists = There's already a user with this email address available. Please login or use another email address.
            }
        }
        message {
            label = Message
            placeholder = Your message
            type = textarea
            eval = trim
            errors {
                isEmpty = Please enter a message
            }
        }
        privacyProtectionConfirmed {
            label = I've read the <a href="%s" target="_blank">privacy protection and accept them</a>
            type = checkbox
            eval = trim
            linkPid = {$themes.configuration.pages.privacy}
            errors {
                isEmpty = Please accept our privacy protection
            }
        }
        termsConfirmed {
            label = I've read the <a href="%s" target="_blank">terms</a> and accept them
            type = checkbox
            eval = trim
            linkPid = {$themes.configuration.pages.terms}
            errors {
                isEmpty = Please accept our terms
            }
        }
        disclaimerConfirmed {
            label = I've read the <a href="%s" target="_blank">disclaimer</a> and accept them
            type = checkbox
            eval = trim
            linkPid = {$themes.configuration.pages.disclaimer}
            errors {
                isEmpty = Please accept the disclaimer
            }
        }
        createFrontendUser {
            label = Please create me a user account
            type = checkbox
            eval = trim
            errors {
                isEmpty = Please confirm that we create you an user account or loggin with your existing account
            }
        }
        deliveryAddressEnabled {
            type = checkbox
            deliveryAddressToggle = 1
            label = Deviating delivery address
        }
        deliveryAddresses {
            label = Address
            type = address
            eval = trim
            deliveryAddress = 1
            errors {
                isEmpty = Please choose your delivery address
            }
        }
        deliveryAddressCompany {
            label = Company
            type = input
            eval = trim
            deliveryAddress = 1
            placeholder = Your company
            errors {
                isEmpty = Please enter your company name
            }
            fetchFrom = delivery_address.company
        }
        deliveryAddressFirstname {
            label = Firstname
            type = input
            eval = trim
            deliveryAddress = 1
            placeholder = Your firstname
            errors {
                isEmpty = Please enter your firstname
            }
            fetchFrom = delivery_address.first_name
        }
        deliveryAddressLastname {
            label = Lastname
            placeholder = Your lastname
            type = input
            eval = trim
            deliveryAddress = 1
            errors {
                isEmpty = Please enter your lastname
            }
            fetchFrom = delivery_address.last_name
        }
        deliveryAddressStreet {
            label = Street
            placeholder = Your street
            type = input
            eval = trim
            deliveryAddress = 1
            errors {
                isEmpty = Please enter your street
            }
            fetchFrom = delivery_address.street
        }
        deliveryAddressHouseNumber {
            label = Housenumber
            type = input
            eval = trim
            deliveryAddress = 1
            placeholder = Your housenumber
            errors {
                isEmpty = Please enter your housenumber
            }
            fetchFrom = delivery_address.house_number
        }
        deliveryAddressPostalCode {
            label = Postal code
            placeholder = Your postal code
            type = input
            eval = trim
            deliveryAddress = 1
            errors {
                isEmpty = Please enter your postal code
            }
            fetchFrom = delivery_address.postal_code
        }
        deliveryAddressCity {
            label = City
            placeholder = Your city
            type = input
            eval = trim
            deliveryAddress = 1
            errors {
                isEmpty = Please enter your city
            }
            fetchFrom = delivery_address.city
        }
        deliveryAddressCountry {
            label = Country
            type = country
            eval = trim
            default = DE
            deliveryAddress = 1
            errors {
                isEmpty = Please choose your country
            }
            fetchFrom = delivery_address.country
        }
        deliveryAddressPhone {
            label = Phone
            placeholder = Your phone number
            type = input
            eval = trim,phone
            deliveryAddress = 1
            errors {
                isEmpty = Please enter your phone number
                isInvalidPhone = Please enter a valid phone number
            }
        }
    }
}

Translation of field definitions

Translations for defined fields can be provided like this:

[siteLanguage("locale") == "de_DE.UTF-8" || siteLanguage("locale") == "de-DE" || siteLanguage("typo3Language") == "de"]
    plugin.tx_shop.settings.basketOrder.fieldDefinition {
        company {
            label = Firma
            placeholder = Ihre Firma
            errors {
                isEmpty = Bitte geben Sie Ihre Firma ein
            }
        }
    }
[END]

Contact request

You can contact us at any time

Stop! Playing in the meantime?
Stop! Playing in the meantime?
Stop! Playing in the meantime?

Stop! Playing in the meantime?

Break the highscore

Press Start
Contact request
Screenreader label
Security question
AZ1_________BWX______
I_Q____D____T_____638
2_1___NA4___9ER______
Y_2____Q____H_Y___UAK
O9O_________X83______