A new version of WooCommerce Blocks has been released! Version 7.2.0 is now available for download from GitHub and WordPress.org. WooCommerce Blocks 7.2.0 will also be included in WooCommerce 6.4.
This release contains some fixes for the Mini Cart Block, and some further improvements for the Store API in preparation for the next release of WooCommerce core.
Dev Notes
Renamed headers
As part of finalising the Store API, we’ve removed all X-
prefixes from the customer response headers (doing so is no longer a recommended practice).
The X-WC-Store-API-Nonce
header has been renamed to Nonce
, so if you’ve been consuming the experimental Store API, this will need to be renamed in your client.
This change also includes X-WC-Store-Api-Nonce-Timestamp
to Nonce-Timestamp
and X-WC-Store-User
to User-ID
.
See #6020 for further details.
Renamed classes and namespaces
Also part of finalising the Store API, we renamed some of our classes and namespaces.
The ExtendRestApi
class is now ExtendSchema
and it now lives under the Automattic\WooCommerce\StoreApi\Schemas
namespace.
The Automattic\WooCommerce\Blocks\RestApi
class has been renamed to Automattic\WooCommerce\StoreApi\StoreApi
.
The namespace Automattic\WooCommerce\Blocks\StoreApi
is now Automattic\WooCommerce\StoreApi
.
Read #5982 for more details.
ExtendRestApi ExtendSchema public functions
You no longer need to call the package manager and get ExtendRestApi ExtendSchema from it, you can call those public functions for the same task:
woocommerce_store_api_register_endpoint_data( $args )
woocommerce_store_api_register_update_callback( $args )
woocommerce_store_api_register_payment_requirements( $args )
woocommerce_store_api_get_formatter( $name )
Those functions receive the same args as the class ones (they’re wrappers).
See #5941.
Changelog
Bug Fixes
- StoreAPI: Clear all wc notice types in the cart validation context #5983
- Fix loading more WC core translations in locales where WC Blocks is not localized for some strings. #6036
- Ensure shipping address is set for virtual orders to prevent missing country errors. #6050
Enhancements
- Memoize/cache filter results so that we don’t call third party filters too often #5143
Various
- Remove v1 string from Store Keys. (5987)
- Introduce the
InvalidCartException
for handling cart validation. (5904) - Renamed Store API custom headers to remove
X-WC-Store-API
prefixes. #5983 - Normalised Store API error codes #5992
- Deprecated
woocommerce_blocks_checkout_order_processed
in favour ofwoocommerce_store_api_checkout_order_processed
- Deprecated
woocommerce_blocks_checkout_update_order_meta
in favour ofwoocommerce_store_api_checkout_update_order_meta
- Deprecated
woocommerce_blocks_checkout_update_order_from_request
in favour ofwoocommerce_store_api_checkout_update_order_from_request
Leave a Reply