Categories
WooCommerce Blocks Release Notes

WooCommerce Blocks 5.1.0 Release Notes

There’s a new version of WooCommerce Blocks available! Version 5.1.0 is now available on WordPress.org and GitHub.

This release includes better error reporting for incorrectly registered payment methods and some improvements to the emitEventWithAbort event emitter. There is also a bug fix related to email and phone field values being cleared unexpectedly with certain shopper behaviour. Read on for more details!

Better error reporting for incorrectly registered payment methods.

When a payment method registers using the payment methods extensibility interface, the feature plugin has some error checking to ensure that the dependencies the plugin lists for its script are actually available during the registration. Without this error check, it’s possible for incorrectly registered payment methods to prevent the loading of any checkout scripts due to the mechanism used internally for managing the loading order of various checkout scripts.

With this release, there are some improvements to the error message logged (PHP error logs and console log) when a payment method doesn’t have all its dependencies registered including:

  • Clarifying this is specific to Cart and Checkout blocks loading process.
  • Only loading the payment methods API interface when Cart and Checkout blocks feature is on (via the feature plugin).

Improvements to emitEventWithAbort

This is more of a internals update that impacts various event emitters using this function (onPaymentProcessing, onCheckoutAfterProcessingWithSuccess, onCheckoutAfterProcessingWithError). If you are a developer authoring a payment method that uses any of these events, your implementation should be unaffected by these changes. It’s mostly to prevent potential bugs where there are multiple payment methods in use by a store (that all implement observers for these events). You can read more about the change in this pr.

Fix for unexpected email and phone field value loss.

There was a bug that surfaced when shoppers filled out the email and phone field and then unchecked the “Use same address for billing” option. The email and phone values would be cleared.

This is fixed in this release so that any previously entered values are preserved when toggling this checkbox.

Changelog

Enhancements

  • Improve error message displayed when a payment method didn’t have all its dependencies registered. (4176)
  • Improvements to emitEventWithAbort. (4158)

Bug Fixes

  • Fix issue in which email and phone fields are cleared when using a separate billing address. (4162)

By Darren Ethier

I’m the father of four children and husband of the most beautiful woman in the world. My passion is developing useful and pretty code. I also love anything to do with leadership and the wise use of words.  Currently I'm employed as a Code Wrangler with Automattic and an engineering team lead for a team working on WooCommerce.

5 replies on “WooCommerce Blocks 5.1.0 Release Notes”

Comments are closed.