WooCommerce Blocks 8.7.0 Release Notes

A new version of WooCommerce Blocks has been released! Version 8.7.0 is now available for download from GitHub and WordPress.org.

In this release we focused on a lot of internal changes and bug fixes. Some highlights include the following:

Cart & Checkout Integration

As a highlight for developers, we made a few changes to the way you integrate with the Cart & Checkout blocks.

WP Data Stores

We moved a lot of the data related to the Checkout process into wp/data stores, which can now be accessed by other plugins to allow more flexibility and creativity when interacting with the Checkout Block. You can read more about these and how to do that here

New filters

We added a new filter for changing the text of the “Place Order” button on the Checkout Block

const { __experimentalRegisterCheckoutFilters } = window.wc.blocksCheckout;
__experimentalRegisterCheckoutFilters( 'custom-place-order-button-label', {
	placeOrderButtonLabel: label,
} );

We also added a filter for disabling the ability to remove items from the Cart Block

const { __experimentalRegisterCheckoutFilters } = window.wc.blocksCheckout;

__experimentalRegisterCheckoutFilters('some-extension-name', {
		showRemoveItemLink: (value, extensions, { cartItem }) => {
			return cartItem.name !== 'Beanie';
		},
	});

Styling filter blocks is now easier

Previously, filter blocks were regular blocks containing a title and filter controls. Those blocks only had a styling option for the title. Also, we can’t style the filter controls without increasing the complexity of the block settings.

Because of those limitations, we upgraded filter blocks to use inner blocks. Each filter block now contains two inner blocks: a core heading block and the filter controls block. The new structures allow merchants to style individual inner blocks, which makes the filter blocks more versatile and easier to customize. In addition, using the core heading block also unlocks many possibilities and functionalities for free.

Changelog

Enhancements

  • Improve visual consistency between block links. (7340)
  • Update the titles of some inner blocks of the Cart block and remove the lock of the Cross-Sells parent block. (7232)
  • Add filter for place order button label. (7154)
  • Exposed data related to the checkout through wordpress/data stores. (6612)
  • Add simple, large & two menus footer patterns. (7306)
  • Add minimal, large, and essential header patterns. (7292)
  • Add showRemoveItemLink as a new checkout filter to allow extensions to toggle the visibility of the Remove item button under each cart line item. (7242)
  • Add support for a GT tracking ID for Google Analytics. (7213)
  • Separate filter titles and filter controls by converting filter blocks to use Inner Blocks. (6978)
  • StoreApi requests will return a Cart-Token header that can be used to retrieve the cart from the corresponding session via GET /wc/store/v1/cart. (5953)

Bug Fixes

  • Fixed HTML rendering in the description of active payment integrations. (7313)
  • Hide the shipping address form from the Checkout when the “Force shipping to the customer billing address” is enabled. (7268)
  • Fixed an error where adding new pages would cause an infinite loop and large amounts of memory used in redux. (7256)
  • Ensure error messages containing HTML are shown correctly in the Cart and Checkout blocks. (7231)
  • Prevent locked inner blocks from sometimes displaying twice. (6676)
  • StoreApi /checkout endpoint now returns HTTP 402 instead of HTTP 400 when a payment fails. (7273)
  • Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com. (7367)

Keep yourself in the loop!

Sign up for the WooCommerce developer newsletter:
Hidden
Hidden
Hidden


Leave a Reply

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