Commerce Commerce 1.x Upgrades v0.10

Most upgrades are automatically applied, but sometimes you may need to update custom templates, or status configuration, to take advantage of new features or improvements. Those changes are discussed here.

Most changes listed in this migration document are optional.

Status Changes

Status changes don’t get updated because we can’t tell if you use the default or a custom set.

In 0.10.0-rc2, we added lexicons for the subjects, and a new email template (instead of inline content) for the email that goes to the merchant.

To edit these in your site, go to Commerce > Configuration > Statuses and click on the status change that’s being used for new orders that have been paid.

Set the subject of the Confirmation email to customer status change action to:

{{ lex('commerce.email.order_rcvd.subject', { name: config.site_name, id: order.id }) }}

If you have the email content in the content field, you can also update that to the nicer email template by setting it to:

{% extends "emails/order-received.twig" %}

For the Confirmation Email to Merchant, which has been renamed Order Notification to Merchant in 0.10.0-rc2, set the subject to:

{{ lex('commerce.email.order_rcvdmerch.subject', { name: billing_address.fullname, site_name: config.site_name, id: order.id }) }}

And the content to:

{% extends "emails/order-to-merchant.twig" %}

Checkout templates

The checkout/partial/summary.twig template changed to show the shipping/billing address with autoformatted addresses. Previously these were in a hardcoded format with vcard, but now the customer country is used to determine how to show the address.

Previous:

{% if shipping_address.id > 0 %}
    <div class="c-shipping">
        <h3>{{ lex('commerce.cart.shipping_information') }}</h3>
        <p class="c-shipping-summary">{{ lex('commerce.cart.shipping_to') }}
            <b>{{ shipping_address.fullname }} [#{{ shipping_address.id }}]</b>
            {% if shipping_method.id %}
                {{ lex('commerce.cart.shipping_with_method') }}
                <b>{{ shipping_method.name }}</b>
            {% endif %}
        </p>
        <p class="c-shipping-address">{{ shipping_address.address1 }}
            {% if shipping_address.address2|length > 0 %}<br>{{ shipping_address.address2 }}{% endif %}
            {% if shipping_address.address3|length > 0 %}<br>{{ shipping_address.address3 }}{% endif %}
            <br>{{ shipping_address.city }}, {{ shipping_address.zip }}
            <br>{{ shipping_address.state }} {{ shipping_address.country_formatted }}
        </p>
    </div>
{% endif %}
{% if billing_address.id > 0 %}
    <div class="c-billing">
        <h3>{{ lex('commerce.cart.billing_information') }}</h3>
        <p class="c-billing-summary">{{ lex('commerce.cart.billing_to') }}
            <b>{{ billing_address.fullname }} [#{{ billing_address.id }}]</b>
        </p>
        <p class="c-billing-address">{{ billing_address.address1 }}
            {% if billing_address.address2|length > 0 %}<br>{{ billing_address.address2 }}{% endif %}
            {% if billing_address.address3|length > 0 %}<br>{{ billing_address.address3 }}{% endif %}
            <br>{{ billing_address.city }}, {{ billing_address.zip }}
            <br>{{ billing_address.state }} {{ billing_address.country_formatted }}
        </p>
    </div>
{% endif %}

New as of 0.10.0-rc2:

{% if shipping_address.id > 0 %}
    <div class="c-shipping">
        <h3>{{ lex('commerce.shipping_address') }}</h3>
        {% if shipping_method.id %}
            <p class="c-shipping-summary">
                {{ lex('commerce.cart.shipping_with_method') }}
                <b>{{ shipping_method.name }}</b>
            </p>
        {% endif %}
        <div class="c-shipping-address">
            {{ shipping_address|format_address }}
        </div>
    </div>
{% endif %}
{% if billing_address.id > 0 %}
    <div class="c-billing">
        <h3>{{ lex('commerce.billing_address') }}</h3>
        <div class="c-billing-address">
            {{ billing_address|format_address }}
        </div>
    </div>
{% endif %}

The frontend/checkout/address.twig template changed massively in 0.10.0-rc1 for the new remembered address feature. If you have a custom address.twig template from 0.9 or before, it is suggested to either copy the new one and re-do your changes, or to leave your custom template as-is, as the functionality remains backwards compatible.