Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Show the phone number field in the billing section when shipping is disabled in settings #3376

Merged
merged 5 commits into from Nov 9, 2020

Conversation

mikejolley
Copy link
Member

Moves the rendering of address fields to a single file so that PhoneNumber (new component) can be rendered in either billing or shipping, depending on visibility, without duplication.

I was going to update context to handle this (hence why I cleaned up some missing docblocks) however, it made more sense to handle this within the address-step component and simply pass around the attributes as before.

Fixes #3231
Fixes #3346

How to test the changes in this Pull Request:

Ensure the phone number field is enabled in block settings, then test 2 cases:

  1. With shipping enabled, ensure phone number displays beneath the shipping step
  2. With shipping disabled (you can delete all rates and zones to edit general settings), ensure phone number displays beneath the billing step.

In both scenarios the values should change and be saved as billing information.

Changelog

Show the phone number field in the billing section when shipping is disabled in settings

@mikejolley mikejolley added this to the 3.8.0 milestone Nov 5, 2020
@mikejolley mikejolley requested a review from a team as a code owner November 5, 2020 17:06
@mikejolley mikejolley self-assigned this Nov 5, 2020
@mikejolley mikejolley requested review from budzanowski and removed request for a team November 5, 2020 17:06
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2020

Size Change: -70 B (0%)

Total Size: 1.12 MB

Filename Size Change
build/cart-frontend.js 70.1 kB +9 B (0%)
build/cart.js 38.8 kB +15 B (0%)
build/checkout-frontend.js 85.9 kB -76 B (0%)
build/checkout.js 42.1 kB -11 B (0%)
build/handpicked-products.js 7.37 kB -2 B (0%)
build/product-on-sale.js 8 kB -2 B (0%)
build/vendors.js 417 kB -3 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/active-filters-frontend.js 8.88 kB 0 B
build/active-filters.js 8.94 kB 0 B
build/all-products-frontend.js 31.2 kB 0 B
build/all-products.js 36.1 kB 0 B
build/all-reviews.js 9.78 kB 0 B
build/atomic-block-components/add-to-cart-frontend.js 8.94 kB 0 B
build/atomic-block-components/add-to-cart.js 7.52 kB 0 B
build/atomic-block-components/add-to-cart~atomic-block-components/button.js 3.19 kB 0 B
build/atomic-block-components/add-to-cart~atomic-block-components/image~atomic-block-components/title.js 335 B 0 B
build/atomic-block-components/button-frontend.js 2.02 kB 0 B
build/atomic-block-components/button.js 840 B 0 B
build/atomic-block-components/category-list-frontend.js 469 B 0 B
build/atomic-block-components/category-list.js 478 B 0 B
build/atomic-block-components/image-frontend.js 1.7 kB 0 B
build/atomic-block-components/image.js 1.15 kB 0 B
build/atomic-block-components/price-frontend.js 2.29 kB 0 B
build/atomic-block-components/price.js 2.32 kB 0 B
build/atomic-block-components/rating-frontend.js 524 B 0 B
build/atomic-block-components/rating.js 526 B 0 B
build/atomic-block-components/sale-badge-frontend.js 857 B 0 B
build/atomic-block-components/sale-badge.js 863 B 0 B
build/atomic-block-components/sku-frontend.js 386 B 0 B
build/atomic-block-components/sku.js 395 B 0 B
build/atomic-block-components/stock-indicator-frontend.js 568 B 0 B
build/atomic-block-components/stock-indicator.js 573 B 0 B
build/atomic-block-components/summary-frontend.js 917 B 0 B
build/atomic-block-components/summary.js 927 B 0 B
build/atomic-block-components/tag-list-frontend.js 467 B 0 B
build/atomic-block-components/tag-list.js 474 B 0 B
build/atomic-block-components/title-frontend.js 1.23 kB 0 B
build/atomic-block-components/title.js 1.06 kB 0 B
build/attribute-filter-frontend.js 18.3 kB 0 B
build/attribute-filter.js 12.5 kB 0 B
build/blocks.js 3.54 kB 0 B
build/editor-rtl.css 13.8 kB 0 B
build/editor.css 13.9 kB 0 B
build/featured-category.js 7.73 kB 0 B
build/featured-product.js 9.97 kB 0 B
build/price-filter-frontend.js 14.9 kB 0 B
build/price-filter.js 10.4 kB 0 B
build/product-best-sellers.js 7.45 kB 0 B
build/product-categories.js 3.23 kB 0 B
build/product-category.js 8.38 kB 0 B
build/product-new.js 7.61 kB 0 B
build/product-search.js 3.56 kB 0 B
build/product-tag.js 6.53 kB 0 B
build/product-top-rated.js 7.58 kB 0 B
build/products-by-attribute.js 8.35 kB 0 B
build/reviews-by-category.js 11.8 kB 0 B
build/reviews-by-product.js 13.4 kB 0 B
build/reviews-frontend.js 9.37 kB 0 B
build/single-product-frontend.js 33.8 kB 0 B
build/single-product.js 10.1 kB 0 B
build/style-rtl.css 17.9 kB 0 B
build/style.css 17.9 kB 0 B
build/vendors-style-rtl.css 1.03 kB 0 B
build/vendors-style.css 1.03 kB 0 B
build/vendors~atomic-block-components/price-frontend.js 5.65 kB 0 B
build/wc-blocks-data.js 7.1 kB 0 B
build/wc-blocks-middleware.js 931 B 0 B
build/wc-blocks-registry.js 2.32 kB 0 B
build/wc-payment-method-bacs.js 790 B 0 B
build/wc-payment-method-cheque.js 787 B 0 B
build/wc-payment-method-cod.js 879 B 0 B
build/wc-payment-method-paypal.js 831 B 0 B
build/wc-payment-method-stripe.js 12 kB 0 B
build/wc-settings.js 2.35 kB 0 B
build/wc-shared-context.js 1.53 kB 0 B
build/wc-shared-hocs.js 1.66 kB 0 B

compressed-size-action

Copy link
Contributor

@budzanowski budzanowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I was wondering why we only have one phone number field but the link to the thread in the Issue has clarified that.
Works nicely! :shipit:

@mikejolley mikejolley merged commit 9700a2e into trunk Nov 9, 2020
@mikejolley mikejolley deleted the fix/3231-phone-field-visibility branch November 9, 2020 11:00
@budzanowski budzanowski added the block: checkout Issues related to the checkout block. label Nov 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: checkout Issues related to the checkout block.
Projects
None yet
2 participants