Revert "Add phone number to my account shipping address. (#47062)" (#48077)

* Revert "Add phone number to my account shipping address. (#47062)"

This reverts commit 4840af874a.

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Seghir Nadir 2024-06-03 09:11:02 +02:00 committed by GitHub
parent d2bde1368a
commit b4efa72b07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 26 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Comment: This reverts an existing PR.

View File

@ -1694,15 +1694,12 @@ class WC_Countries {
$address_fields[ $type . $key ] = $value;
}
// Add fields to address forms.
if ( in_array( $type, array( 'billing_', 'shipping_' ), true ) ) {
// Add phone to billing/shipping address form.
$show_phone_field = get_option( 'woocommerce_checkout_phone_field', 'required' );
if ( 'hidden' !== $show_phone_field ) {
$address_fields[ $type . 'phone' ] = array(
// Add email and phone fields.
if ( 'billing_' === $type ) {
if ( 'hidden' !== get_option( 'woocommerce_checkout_phone_field', 'required' ) ) {
$address_fields['billing_phone'] = array(
'label' => __( 'Phone', 'woocommerce' ),
'required' => 'required' === $show_phone_field,
'required' => 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ),
'type' => 'tel',
'class' => array( 'form-row-wide' ),
'validate' => array( 'phone' ),
@ -1710,19 +1707,15 @@ class WC_Countries {
'priority' => 100,
);
}
// Add email to billing address form.
if ( 'billing_' === $type ) {
$address_fields['billing_email'] = array(
'label' => __( 'Email address', 'woocommerce' ),
'required' => true,
'type' => 'email',
'class' => array( 'form-row-wide' ),
'validate' => array( 'email' ),
'autocomplete' => 'no' === get_option( 'woocommerce_registration_generate_username' ) ? 'email' : 'email username',
'priority' => 110,
);
}
$address_fields['billing_email'] = array(
'label' => __( 'Email address', 'woocommerce' ),
'required' => true,
'type' => 'email',
'class' => array( 'form-row-wide' ),
'validate' => array( 'email' ),
'autocomplete' => 'no' === get_option( 'woocommerce_registration_generate_username' ) ? 'email' : 'email username',
'priority' => 110,
);
}
/**

View File

@ -960,7 +960,7 @@ test.describe.serial( 'Tax rates in the cart and checkout', () => {
.getByRole( 'textbox', { name: 'ZIP Code *' } )
.type( customer.billing.us.zip );
await page
.getByRole( 'textbox', { name: 'Phone *' } )
.getByLabel( 'Phone *' )
.fill( customer.billing.us.phone );
await page
.getByLabel( 'Email address *' )

View File

@ -333,9 +333,7 @@ test.describe( 'Checkout page', () => {
await page
.getByRole( 'textbox', { name: 'ZIP Code *' } )
.fill( '97403' );
await page
.getByRole( 'textbox', { name: 'Phone *' } )
.fill( '555 555-5555' );
await page.getByLabel( 'Phone *' ).fill( '555 555-5555' );
await page.getByLabel( 'Email address *' ).fill( guestEmail );
await page.getByText( 'Cash on delivery' ).click();

View File

@ -108,7 +108,6 @@ test.describe( 'Customer can manage addresses in My Account > Addresses page', (
await page.locator( '#shipping_country' ).selectOption( 'US' );
await page.locator( '#shipping_state' ).selectOption( 'NY' );
await page.locator( '#shipping_postcode' ).fill( '10010' );
await page.locator( '#shipping_phone' ).fill( '555 555-5555' );
await page.locator( 'text=Save address' ).click();
// verify shipping address has been applied