Translate extra fields

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

FieldTypeDescription
titleTranslatedobjkeeps the translations for extra field title
tipTranslatedobjkeeps the translations for extra field tip
subtitleTranslatedobjkeeps the translations for extra field subtitle
valueTranslatedobjkeeps the translations for extra field value
textPlaceholderTranslatedobjkeeps the translations for extra field textPlaceholder

 

Attributes for translating select fields or toggleButtonGroup buttons options

FieldTypeDescription
titleTranslatedobjkeeps the translations for options title
subtitleTranslatedobjkeeps 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();