Commerce v1 Upgrades v0.11

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.

Product Images

Commerce 0.11 saw the release of primary product images. This allows you to add one image to products to show it in the cart/checkout.

For this purpose, the default template frontend/checkout/cart/items.twig was slightly updated.

  • Around line 6, a new empty header was added: <th id="c-cart-header-image">&nbsp;</th>
  • Around line 16, the colspan wrapping the cart update button was changed from 5 to 6.
  • Around line 24, the following column was added to show the image:
<td class="c-cart-item-image">
    {% if item.image %}
        <img src="{{ item.image }}" alt="{{ }}" onerror=" = 'none';">
    {% endif %}

If you're using Resource Products, a new commerce.resourceproduct.image_field system setting allows you to connect an image TV to the Commerce products table.

If you have a custom product type that does not inherit the fields from comProduct, look at core/c../c../model/commerce/comproduct.class.php around line 299 for the field definition used in the standard commerce form.

For custom product types that fetch information from a different table/source look at comresourceproduct.class.php around line 118 for the new getImage() method you can also override in your product type. Make sure to also update your synchronise method.

Shipping Methods (Shipments)

In v0.11 we also refactored the built-in shipping methods to base calculations on the order shipments, instead of the full order. This applies to both the pricing and availability.

This was announced in 0.8 and is now complete. While it should be backwards compatible, please verify any custom shipping methods still work as expected.