From 29b9e2773eea4b5f1dc79121ca1d7adbe3252f02 Mon Sep 17 00:00:00 2001 From: Nadir Seghir Date: Tue, 15 Aug 2023 13:45:48 +0100 Subject: [PATCH] sync shipping phone to billing --- .../inner-blocks/checkout-shipping-address-block/block.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx index 9a671c9ec4a..2252945f6d9 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx @@ -52,6 +52,7 @@ const Block = ( { setBillingAddress, shippingAddress, billingAddress, + setBillingPhone, setShippingPhone, useShippingAsBilling, setUseShippingAsBilling, @@ -156,6 +157,12 @@ const Block = ( { value={ shippingAddress.phone } onChange={ ( value ) => { setShippingPhone( value ); + if ( useShippingAsBilling ) { + setBillingPhone( value ); + dispatchCheckoutEvent( 'set-phone-number', { + step: 'biling', + } ); + } dispatchCheckoutEvent( 'set-phone-number', { step: 'shipping', } );