You can use the customer.firstname and customer.lastname variables to only show part of the customer's name in an order template.
Here is an example of how you can modify the default Customer Account Statement Template to only show the initial of the customer's first name, followed by their last name:
Default Code
Code to be modified highlighted in red:
<div class="billing">
<h3>Bill To</h3>
<h4>{{ customer.full_name }}</h4>
<span>
{{customer.address}}<br />
{{customer.city}}, {{customer.state}} {{ customer.zip }}
</span>
</div>
Custom Code
Replace the code in red above with the code in red below, as follows:
<div class="billing">
<h3>Bill To</h3>
<h4>{{ customer.firstname | truncate: 2, "." }} {{ customer.lastname }}</h4>
<span>
{{customer.address}}<br />
{{customer.city}}, {{customer.state}} {{ customer.zip }}
</span>
</div>
Result
Still have questions? Use the Search Tool at the top of the page to find more related guides. Need help? Click the icon to submit a support ticket – our Client Services team is ready to assist!
Comments
0 comments
Please sign in to leave a comment.