Merge branch 'trunk' into update/auto-insert-mini-cart-into-tt3

This commit is contained in:
Tom Cafferkey 2023-12-13 14:31:05 +00:00 committed by GitHub
commit 136bb741b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Update template to use new function register_block_type_from_metadata

View File

@ -33,6 +33,8 @@
use Automattic\WooCommerce\Admin\BlockTemplates\BlockTemplateInterface;
use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\ProductFormTemplateInterface;
use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\BlockRegistry;
/**
* Registers the block using the metadata loaded from the `block.json` file.
@ -43,7 +45,7 @@ use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\Pr
*/
function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
if ( isset( $_GET['page'] ) && $_GET['page'] === 'wc-admin' ) {
register_block_type( __DIR__ . '/build' );
BlockRegistry::get_instance()->register_block_type_from_metadata( __DIR__ . '/build' );
}
}
add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix: Display update quantity notice when using the cart shortcode.

View File

@ -88,7 +88,7 @@ jQuery( function( $ ) {
var $html = $.parseHTML( html_str );
var $new_form = $( '.woocommerce-cart-form', $html );
var $new_totals = $( '.cart_totals', $html );
var $notices = remove_duplicate_notices( $( '.woocommerce-error, .woocommerce-message, .woocommerce-info', $html ) );
var $notices = remove_duplicate_notices( $( '.woocommerce-error, .woocommerce-message, .woocommerce-info, .is-error, .is-notice, .is-success', $html ) );
// No form, cannot do this.
if ( $( '.woocommerce-cart-form' ).length === 0 ) {