Commerce v1 Upgrades v0.12

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.

New shop_resource setting

Previously, an empty cart would link to the site_start setting, but now in 0.12 we're linking to a new commerce.shop_resource setting instead. This is useful to change where the customer is sent without needing to create a custom template just for that.

To tweak this in existing custom templates, edit your frontend/checkout/cart.twig template, around line 28, from:

<p><a href="[[~[[++site_start]]]]">{{ lex('commerce.cart.no_items_yet') }} {{ lex('commerce.cart.continue_shopping') }}</a></p>
<p><a href="{{ shop_root_url }}">{{ lex('commerce.cart.no_items_yet') }} {{ lex('commerce.cart.continue_shopping') }}</a></p>

The {{ shop_root_url }} placeholder is available throughout the entire checkout.

Note: get_product now looks at the first valid product

Previously the commerce.get_product snippet only looked at the very first product ID listed. If that product was removed or invalid, it would not return any product at all. Now, the snippet will use all product IDs to find the first option that still exists.

In normal usage, this should not cause any changes in behaviour, but it's worth double checking your catalog to make sure it will still behave the way you expect it to.

Add to cart now in the lexicon

You can now use [[%commerce.add_to_cart]] (in MODX templates) or {{ lex('commerce.add_to_cart') }} in your add to cart forms. This is not required, but will automatically be translated for you in supported languages.