A split shipping toggle button allows users to activate or deactivate split shipping for the current order. The button toggles the state of the isSplitShipping
property. Also, it may be necessary to toggle the visibility of split shipping/single shipping UI elements.
The following sequence diagrams shows how you might choose to activate and deactivate the split shipping toggle on your storefront.
Activate
In this diagram, the following happens:
The shopper clicks a Use Split Shipping button on the UI, which calls the Checkout Address Book widget’s
toggleSplitShipping()
method.The
toggleSplitShipping()
method sets theCartViewModel.isSplitShipping
property totrue
.The Checkout Address Book widget shows the Ship To Multiple Addresses UI and hides the Ship To Single Address UI.
Deactivate
In this diagram, the following happens:
The shopper clicks the Use Single Shipping button on the UI, which calls the Checkout Address Book widget’s
toggleSplitShipping()
method.The
toggleSplitShipping()
method sets theCartViewModel.isSplitShipping
property tofalse
.The Checkout Address Book widget shows the Ship To Single Address UI and hides the Ship To Multiple Addresses UI.