Commerce 1.3

Are you ready for one of the biggest Commerce releases yet?

We first showed some of the highlights of 1.3 at the MODXpo, but still had a list of features we were looking to implement. Over the last months we've had regular developer builds available for testing while we worked on those features, and we're now ready to move to the release candidate phase.

As a release candidate, we don't recommend immediately updating your production sites. Test on a staging environment first and make a backup, just in case. Let us know if you run into any issues so we can address those. Also: review the upgrade notes here.

There are a ton of new features in 1.3, so let's dive in!

Internationalization in the core

With Commerce 1.3, we've added multilingual capabilities to the core.

Your products, payment methods, and shipping methods can now be configured to make their user-facing fields translatable. This gives the user a very simple inline dropdown to switch beween languages, and the front-end will automatically render the right language - with no changes to your templates needed.

Screenshot of the multilingual interface in Commerce 1.3. At the right of each translateable field, a dropdown shows the available languages.

As long as the cultureKey setting matches one of the enabled languages, your placeholders like [[+name]] and [[+description]] will automatically contain the translated values if available - falling back to your primary language if not. Specific translations are also available to you with a language suffix; e.g. [[+name_en]].

This feature is also available for custom models and extensions with just a few lines of code. Developer documentation on implementing that is available here.

Authorize & Capture flows + new gateway features

In certain industries, it's common to authorize during the checkout, but not actually capture the payment until later - for example when shipping an order. In other use cases, you may want to have an order enter the processing state, without taking payment online, and not having the order shown as paid in the list.

Both of those use cases are now possible with Authorize & Capture flows, available in the Stripe and Manual gateways with very minimal configuration. Other gateways may follow in upcoming releases based on demand and availability.

The Stripe gateway now supports all payment options Stripe has to offer from a single UI. That includes local payment methods like iDeal, Sofort, etc. All plug & play, replacing the previous card-only UI on upgrade. Note Apple Pay does require verification before it will show up.

Mollie can now accept credit cards on-page, no longer needing the redirect to the hosted payment page. That does require some extra configuration, and is best used alongside the other implementations, so you'll want to check out your payment method configuration to add that.

Webhooks

We've added a new status change action to Commerce that will let you send webhooks (HTTP requests) to third-party services as part of your status workflow.

The webhook optionally contains all order information, so this is great for simple integrations where you want to send data from Commerce elsewhere.

Webhooks particularly shine in combination with Zapier. You can send the order information to Zapier, and have that forward (and map) that data to any of its 5000+ connected app, opening up a lot of no-code integration options. You can learn how to set that up in the documentation.

Built-in Scheduler

There's now a background- and scheduled-task queue built into Commerce. That requires setting up a cron job to make it run, and can then be used for all sorts of background processing or running tasks at a predefined point in the future.

We're curious to see what you'll build with the Scheduler. Here's more information.

Dependency updates

We spend quite some time this release on updating internal dependencies. Bumping the minimum requirement to 7.4 has allowed us to replace some very old versions of libraries with newer ones. Commerce has been around for 7 years now, so while it's not the shiniest work, keeping things up-to-date and performing this sort of maintenance work is important.

Most of these updates are under the hood, and don't affect the typical user, but there are exceptions. Especially developers of extensions should take note of the changes in this release.

  • The Twig update from 1.x to 3.x includes one minor change that may affect your templates, due to the removal of the {% spaceless %} filter. This needs to use the apply syntax, i.e. {% apply spaceless %}. When upgrading to 1.3, Commerce will scan your templates automatically and attempt to fix it, but this is something you'll want to confirm it went correctly. It also does may not scan extension template paths.
  • Guzzle 6 has been removed, and we're now relying on the guzzle7 package. It should get automatically installed on upgrade. Any modules that may have relied on Guzzle 6 will need to be updated.
  • Omnipay has been updated from 2.x to 3.x. This should not cause many issues as the differences are small and 3.x has been available for years, but some older Omnipay-based gateways may need to be updated. The list here is useful to see if a custom gateway implementation may be affected.

If you run into any issues adapting to these changes, drop us a note and we'd be happy to help.

And more!

There are a ton of other features and improvements as well, we're not going to cover them all individually. 

  • A new order processing lock was added to avoid issues with orders being processed twice simultaneously. This recently became a common problem with Mollie, which uses both webhook and checkout-based payment verifications.
  • New option to list all products, useful for microstores with just a few products.
  • Ability to empty the cart in one click.
  • Ability to edit any order item. If they were previously assigned a product, they will be unlinked when edited.
  • Validation for address properties in the basic address validation module.
  • A new snippet to use as collections column renderer.
  • In the Commerce dashboard, changing a type dropdown (such as type of shipping method) will now immediately refresh the form to show the new fields. Previously you had to save first.
  • Minor update to the dashboard, now shows top 5 products again.
  • Normal product prices are now stored on order items with the regular_price and regular_price_formatted placeholders. This is meant to show before/after prices when a product has a discounted price.
  • Date and time formatting now uses the manager_date_format and manager_time_format system settings to determine formatting.
  • Descriptions on fields in the Commerce dashboard can now include HTML formatting, while still protecting against XSS. This means you'll find useful links to actually be clickable!
  • Date and datetime fields now use a custom date picker for cross-browser-compatibility. Looking at you, Safari.
  • Image types that can be used on products are now configurable, and include webp/avif by default.
  • Plus assorted bug fixes.

What's next?

Over the coming weeks we'll be focused on stabilising this release and resolving any issues that may pop up. At the same time we'll be working on some exciting extensions and integrations, and we'll be putting a lot of time into ContentBlocks the coming months as well to bring that to 2.0 with a new design and more.

Stay tuned!