From 60f3963d839a2c51f5944e1047d0c53998ecbd98 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Mon, 17 Apr 2023 14:23:00 +0200 Subject: [PATCH 1/3] Blockfied Single Product Template: Add support for template for specific product (#9069) --- src/BlockTemplatesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BlockTemplatesController.php b/src/BlockTemplatesController.php index 68c9f73d738..632cc85a58b 100644 --- a/src/BlockTemplatesController.php +++ b/src/BlockTemplatesController.php @@ -325,7 +325,7 @@ function( $template ) { $template->description = BlockTemplateUtils::get_block_template_description( $template->slug ); } - if ( 'single-product' === $template->slug ) { + if ( str_contains( $template->slug, 'single-product' ) ) { if ( ! is_admin() && ! BlockTemplateUtils::template_has_legacy_template_block( $template ) ) { $new_content = SingleProductTemplateCompatibility::add_compatibility_layer( $template->content ); From 873a24b0a40236e5c277520bee965ee02b3b60b5 Mon Sep 17 00:00:00 2001 From: leonardo lopes de albuquerque Date: Mon, 17 Apr 2023 10:57:09 -0300 Subject: [PATCH 2/3] Fixed trim is not a function error when address has an attribute that is not a string (#8988) --- assets/js/data/cart/push-changes.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/js/data/cart/push-changes.ts b/assets/js/data/cart/push-changes.ts index 2fd720de047..55fa8116c52 100644 --- a/assets/js/data/cart/push-changes.ts +++ b/assets/js/data/cart/push-changes.ts @@ -41,13 +41,20 @@ const isBillingAddress = ( export const normalizeAddress = ( address: BillingOrShippingAddress ) => { const trimmedAddress = Object.entries( address ).reduce( ( acc, [ key, value ] ) => { + //Skip normalizing for any non string field + if ( typeof value !== 'string' ) { + acc[ key as keyof BillingOrShippingAddress ] = value; + return acc; + } + if ( key === 'postcode' ) { acc[ key as keyof BillingOrShippingAddress ] = value .replace( ' ', '' ) .toUpperCase(); - } else { - acc[ key as keyof BillingOrShippingAddress ] = value.trim(); + return acc; } + + acc[ key as keyof BillingOrShippingAddress ] = value.trim(); return acc; }, {} as BillingOrShippingAddress From 08278f418e50c52d3f4ddbc7f5dd04a37f7659ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Mon, 17 Apr 2023 18:52:43 +0200 Subject: [PATCH 3/3] Mini Cart: Remove excessive margin under cart items (#9051) --- .../cart-checkout/cart-line-items-table/style.scss | 2 +- assets/js/blocks/cart/style.scss | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss b/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss index 3d92b32bf10..0d34496c7c1 100644 --- a/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss +++ b/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss @@ -5,7 +5,7 @@ table.wc-block-cart-items td { background: none !important; // Remove borders on default themes. border: 0; - margin: 0 0 2em; + margin: 0; } .editor-styles-wrapper table.wc-block-cart-items, diff --git a/assets/js/blocks/cart/style.scss b/assets/js/blocks/cart/style.scss index 7fc38b3db23..6098c4a132d 100644 --- a/assets/js/blocks/cart/style.scss +++ b/assets/js/blocks/cart/style.scss @@ -12,13 +12,17 @@ } } } -} -.wc-block-cart { .wc-block-components-totals-taxes, .wc-block-components-totals-footer-item { margin: 0; } + + table.wc-block-cart-items, + table.wc-block-cart-items th, + table.wc-block-cart-items td { + margin: 0 0 2em; + } } // Loading placeholder state.