Show extra fields in an order

Add a new field to order comments at store checkout

// Place Ecwid integration code here
// ...

// Init order fields 
ec.order = ec.order || {};
ec.order.extraFields = ec.order.extraFields || {};

// Add new text field to order comments section at checkout
ec.order.extraFields.how_you_found_us = {
    'title': 'How did you find us?',
    'textPlaceholder': 'Describe here please!',
    'type': 'text',
    'required': false,
    'checkoutDisplaySection': 'order_comments', // show new field in order comments block
    'orderDetailsDisplaySection': 'order_comments' // show saved data in order comments block in order details to merchant and customer

You can show your saved extra field title and value in order details. It will be displayed to both merchant and customer who placed that order.

It is possible to customize the position of this information with orderDetailsDisplaySection field. Possible values for it include: shipping_info, billing_info, customer_info, order_comments.

Check a basic example on the right.

Extra field display requirements

Extra fields will only be shown in an order details to customer and store admin if these conditions are met:

  • title is not empty
  • value is not empty
  • orderDetailsDisplaySection contains supported value: shipping_info, billing_info, customer_info, order_comments. More on this below