Invoice Notification Ship to Name Different Than User

On the invoice notification template, there is the following code for the ship to name:

        {% if u.s_firstname %}
            <strong>{{u.s_firstname}} {{u.s_lastname}}</strong>
        {% else %}
            <strong>{{u.firstname}} {{u.lastname}}</strong>
        {% endif %}

Even though the ship to name is different than the user, the users name shows instead of the ship to name.

So my question is, what is the point of the else statement and why doesn’t it use the ship to name instead of the user name?

Okay, I found out that it’s not the invoice document that is used but it’s the order summary document that is used. In the order summary document, only the user name is used so I added the if statement instead.

Order summary document ship to code snippet replace:
<strong>{{u.firstname}} {{u.lastname}}</strong>
with:

        {% if u.s_firstname %}
            <strong>{{u.s_firstname}} {{u.s_lastname}}</strong>
        {% else %}
            <strong>{{u.firstname}} {{u.lastname}}</strong>
        {% endif %}
2 Likes

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.