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)


Keep yourself in the loop!

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form


5 responses to “WooCommerce Blocks 5.1.0 Release Notes”

  1. […] Blocks 5.1.0: The package update includes 5.0.0 and 5.1.0. Please note that most content included in Blocks updates is not present in WooCommerce unless the […]

  2. […] Blocks 5.1.0: The package update includes 5.0.0 and 5.1.0. Please note that most content included in Blocks updates is not present in WooCommerce unless […]

  3. […] WooCommerce Blocks 5.1.0 was released on May 10, 2021. Highlights include better error reporting for payment methods with dependencies that are unavailable, improvements to the emitEventWithAbort function that some event emitters use, and a fix for a bug that would clear out previously entered address data during checkout. […]

  4. […] Blocks 5.1.0: The package update includes 5.0.0 and 5.1.0. Please note that most content included in Blocks updates is not present in WooCommerce unless the […]

Leave a Reply

Your email address will not be published. Required fields are marked *