Knowledge base
Guides
Academy
Video tutorials
Try searching for:
Recently viewed articles:

Table of contents

Using the order extra fields

Order extra fields allow you to save some additional information to orders — buyers can add custom data at checkout and this information will appear in the orders details in Ecwid admin panel. It can be visible or hidden from customer.

Additional tools for working with order extra fields include two functions and an array of objects: getOrderExtraFieldValue("key")getOrderExtraField("key"), order.extraFields.

You can find more information on order extra fields in Ecwid API documentation.

Order extra fields structure: 

${order.extraFields}  
<#list order.extraFields as extraField> </#list> Displays the list of order extra fields.
${extraField.key} Displays the extra field' key.
${extraField.value} Displays the extra field's value.
${extraField.title} Displays the extra field' title. Optional.
${extraField.orderDisplaySection} Displays the extra field's title. Optional.
${extraField.type} Displays the extra field's type. 

Here are some examples: 

Show all order extra fields set to be visible in order details (title and orderDisplaySection is specified)

<#list order.extraFields as extraField>
	<#if extraField.title?has_content && extraField.orderDisplaySection?has_content>
${extraField.title}: ${extraField.value}
	</#if>
</#list>

Print value of a specific order extra field

<#assign myExtraFieldValue = getOrderExtraFieldValue("askHowYouFoundUsApp")>
<#if myExtraFieldValue?has_content>
	${myExtraFieldValue}
</#if>

Where "askHowYouFoundUsApp" is the key of your order extra field.

Print specific fields of a specific order extra field (remove fields you don't need to show)

<#assign myExtraField = getOrderExtraField("askHowYouFoundUsApp")>
${myExtraField.key}
${myExtraField.value}
${myExtraField.type}
${myExtraField.orderDisplaySection}
${myExtraField.title}

Where "askHowYouFoundUsApp" is the key of your order extra field.

Was this article helpful?

Awesome! Thanks for your feedback!

Thanks for your feedback!

Sorry about that! What went wrong?
0 out of 3 found this helpful
10
We use cookies and similar technologies to remember your preferences, measure effectiveness of our campaigns, and analyze depersonalized data to improve performance of our site. By choosing «Accept», you consent to the use of cookies.
Accept cookies Decline