You can show extra field title, value, options, tip, etc to the customers in different languages depending on their browser default language. If translations for the customer's browser language is specified in the extra field attributes for translations, the customer will see the translated values. If not, they will see the values from the default extra fields attributes (title
, value
, tip
, etc).
Languages that are used in the extra field's attributes for translations must be enabled for your store. How to enable them?
Extra field attributes for translations
Field | Type | Description |
---|---|---|
titleTranslated | obj | keeps the translations for extra field title |
tipTranslated | obj | keeps the translations for extra field tip |
subtitleTranslated | obj | keeps the translations for extra field subtitle |
valueTranslated | obj | keeps the translations for extra field value |
textPlaceholderTranslated | obj | keeps the translations for extra field textPlaceholder |
Attributes for translating select
fields or toggleButtonGroup
buttons options
select
fields or toggleButtonGroup
buttons optionsField | Type | Description |
---|---|---|
titleTranslated | obj | keeps the translations for options title |
subtitleTranslated | obj | keeps the translations for options subtitle |
window.ec = window.ec || {};
ec.order = ec.order || {};
ec.order.extraFields = ec.order.extraFields || {};
ec.order.extraFields.how_did_you_find_us = {
'title': 'How did you find us?',
'titleTranslated': {
'en': 'How did you find us?',
'ru': 'Как вы нас нашли?'
},
'type': 'select',
'required': false,
'options': [
{
'title': 'Google Ads',
'titleTranslated': {
'en': 'Google Ads',
'ru': 'Реклама в Google'
}
},
{
'title': 'Friend told me',
'titleTranslated': {
'en': 'Friend told me',
'ru': 'Друг рассказал'
}
},
{
'title': 'Other',
'titleTranslated': {
'en': 'Other',
'ru': 'Другое'
}
}
],
'value': 'Google Ads', // Default value
'valueTranslated': {
'en': 'Google Ads',
'ru': 'Реклама в Google'
},
'checkoutDisplaySection': 'payment_details'
};
window.Ecwid && Ecwid.refreshConfig();