-
Notifications
You must be signed in to change notification settings - Fork 219
Add setting to Checkout block to control Hide shipping costs until an address is entered option #8680
Add setting to Checkout block to control Hide shipping costs until an address is entered option #8680
Conversation
92ed998
to
f0c1fe7
Compare
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
assets/js/blocks/cart-checkout-shared/payment-methods/test/payment-methods.js
assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx assets/js/blocks/cart/test/block.js assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/edit.tsx assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/edit.tsx assets/js/data/cart/reducers.ts assets/js/data/payment/utils/check-payment-methods.ts assets/js/editor-components/expandable-search-list-item/expandable-search-list-item.tsx assets/js/editor-components/product-attribute-term-control/index.js assets/js/editor-components/search-list-control/search-list-control.tsx assets/js/utils/attributes.ts packages/checkout/filter-registry/index.ts |
Size Change: +680 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Required because importing from the index causes the validation data store to register twice
This reverts commit 9967dc0.
Update `wc/store/cart` to handle hidden shipping costs until address is entered
This PR is based on
remove/core-shipping-settings
#8679 - I split it up to make the changes easier to review.This PR adds a control to the editor when selecting either the
Shipping Method
block or theShipping Options
block. The control is used to change theHide shipping costs until an address is entered
option, this was removed from WC Core in #8679 and is now a block option.The setting is present on two blocks, and changing it on one block will also affect the other block. This is achieved by the
updateAttributeInSiblingBlock
function I added in f47cb95In 18af032 I also added a filter to override the
woocommerce_shipping_cost_requires_address
option - this should always beno
if the Checkout block is in use, because we will instead use the block control.This PR contains commit 92ed998 which will be reverted in the next PR. This commit was included to make the PR testable.
Screenshots
Testing
Automated Tests
User Facing Testing
Shipping Method
blockHide shipping costs until an address is entered
option in the block sidebar.Shipping options
block, see the same option. Ensure the value is the same as what it was in step 4.true
then you should see the textShipping options will be displayed here after entering your full shipping address.
instead of shipping options.Shipping Method
block and toggle the option there. View theShipping options
block while toggling and ensure it changes.See loom for testing: https://www.loom.com/share/e28c4b49835b44d99a762aca14e80b7f
WooCommerce Visibility
Performance Impact
Changelog