Skip to content

Commit 8b86c8c

Browse files
committed
reuse util func
Signed-off-by: d.phan <d.phan@salesforce.com>
1 parent 9cfb92d commit 8b86c8c

File tree

1 file changed

+5
-2
lines changed
  • packages/template-retail-react-app/app/pages/cart

1 file changed

+5
-2
lines changed

packages/template-retail-react-app/app/pages/cart/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ import {
8181
import {useCurrentCustomer} from '@salesforce/retail-react-app/app/hooks/use-current-customer'
8282
import UnavailableProductConfirmationModal from '@salesforce/retail-react-app/app/components/unavailable-product-confirmation-modal'
8383
import {getUpdateBundleChildArray} from '@salesforce/retail-react-app/app/utils/product-utils'
84-
import {isPickupShipment} from '@salesforce/retail-react-app/app/utils/shipment-utils'
84+
import {
85+
isPickupShipment,
86+
groupShipmentsByDeliveryOption
87+
} from '@salesforce/retail-react-app/app/utils/shipment-utils'
8588
import {useSelectedStore} from '@salesforce/retail-react-app/app/hooks/use-selected-store'
8689
import {useMultiship} from '@salesforce/retail-react-app/app/hooks/use-multiship'
8790

@@ -378,7 +381,7 @@ const Cart = () => {
378381
}
379382

380383
// Don't assign methods until at least one delivery shipment has an address
381-
const deliveryShipments = basket.shipments?.filter((s) => !isPickupShipment(s)) || []
384+
const {deliveryShipments} = groupShipmentsByDeliveryOption(basket)
382385
const hasDeliveryWithAddress = deliveryShipments.some(
383386
(s) => s.shippingAddress?.address1
384387
)

0 commit comments

Comments
 (0)