You can use the following variables to show custom customer fields and custom customer company fields in the Order Template.
- customer.custom_fields.field_name
- customer.company_account.custom_fields.field_name
Replace field_name with the name of the field. Use lowercase and add an underscore to replace all characters which are not letters or numbers.
Here is an example of how you can modify the default Order Template to show a custom customer company field.
Default Code
<div class="billing">
<h3>Billing Address</h3>
<h4>{{ customer.full_name }}{% if customer.company %}<br>{{ customer.company }}{% endif %}</h4>
<span>
{{customer.address}}<br />
{{customer.city}}, {{customer.state}} {{customer.country_name}} {{ customer.zip }}
</span>
<span>
PH: {{ customer.phone_number }}<br/>
Email: {{ customer.email }}
</span>
</div>
Custom Code
Add the code in red to the default code shown above as follows:
<div class="billing">
<h3>Billing Address</h3>
<h4>{{ customer.full_name }}{% if customer.company %}<br>{{ customer.company }}{% endif %}</h4>
{% if customer.has_company_account? %}
<span>
{{customer.company_account.custom_fields.billing_department}}
</span>
{% endif %}
<span>
{{customer.address}}<br />
{{customer.city}}, {{customer.state}} {{customer.country_name}} {{ customer.zip }}
</span>
<span>
PH: {{ customer.phone_number }}<br/>
Email: {{ customer.email }}
</span>
</div>
Comments
0 comments
Please sign in to leave a comment.