Skip to content

Commit e7f146c

Browse files
@W-19688128 Order Details supports multiship and BOPIS (#3414)
1 parent a2e9964 commit e7f146c

File tree

13 files changed

+675
-95
lines changed

13 files changed

+675
-95
lines changed

packages/template-retail-react-app/CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
## v8.2.0-dev (Sep 26, 2025)
22
- [Bugfix] Fix footer heading semantic consistency and alignment. Fix accessibility compliance by adding proper h1 headings to checkout pages to resolve the page-has-heading-one accessibility rule violation. [#3398](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3398)
33
- [Bugfix] Use `serverSafeEncode` util for address mutations. [#3380](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3380)
4+
- My Account Order Details page correctly shows orders with BOPIS and with Multiple shipments [#3414](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3414)
5+
- Fix bug where pick up items were displaying delivery stock levels instead of in store stock levels [#3401](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3401)
6+
- When registering a guest user on the confirmation page only save the delivery addresses to the new account
7+
[#3412](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3412)
8+
49
## v8.1.0 (Sep 25, 2025)
510
- Updated search UX - prices, images, suggestions new layout [#3271](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3271)
611
- Updated the UI for StoreDisplay component which displays pickup in-store information on different pages. [#3248](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3248)
@@ -9,11 +14,8 @@
914
- Enhanced the shopping assistant that integrates Salesforce Embedded Messaging Service with PWA Kit applications, adding comprehensive context support, localization capabilities, and improved user experience features. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
1015
- Removed domainUrl, locale, basetId properties as part off the ShopperAgent during initialization. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
1116
- Only show option to deliver to multiple addresses if there are multiple items in the basket. [#3336](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3336)
12-
- When registering a guest user on the confirmation page only save the delivery addresses to the new account
13-
[#3412](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3412)
1417
- Added support for Choice of Bonus Products feature. Users can now select from available bonus products when they qualify for the associated promotion. The bonus product selection flow can be entered from either the "Item Added to Cart" modal (when adding the qualifying product to the cart) or from the cart page. [#3292] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3292)
1518
- Add @h4ad/serverless-adapter to jest config [#3325](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3325)
16-
- Fix bug where pick up items were displaying delivery stock levels instead of in store stock levels [#3401](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3401)
1719

1820
## v8.0.0 (Sep 04, 2025)
1921
- Add support for environment level base paths on /mobify routes [#2892](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2892)

packages/template-retail-react-app/app/components/multiship/multiship-order-summary.jsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: BSD-3-Clause
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7-
import React from 'react'
7+
import React, {useMemo} from 'react'
88
import {defineMessages, FormattedMessage} from 'react-intl'
99
import PropTypes from 'prop-types'
1010
import {
@@ -21,13 +21,16 @@ import CartItemVariantAttributes from '@salesforce/retail-react-app/app/componen
2121
import CartItemVariantPrice from '@salesforce/retail-react-app/app/components/item-variant/item-price'
2222
import {STORE_LOCATOR_IS_ENABLED} from '@salesforce/retail-react-app/app/constants'
2323
import {getConfig} from '@salesforce/pwa-kit-runtime/utils/ssr-config'
24-
import {isPickupShipment} from '@salesforce/retail-react-app/app/utils/shipment-utils'
24+
import {groupShipmentsByDeliveryOption} from '@salesforce/retail-react-app/app/utils/shipment-utils'
2525

2626
const MultiShipOrderSummary = ({order, productItemsMap, currency}) => {
2727
const storeLocatorEnabled = getConfig()?.app?.storeLocatorEnabled ?? STORE_LOCATOR_IS_ENABLED
2828
// Group shipments by type (pickup vs delivery)
29-
const pickupShipments = []
30-
const deliveryShipments = []
29+
const {pickupShipments, deliveryShipments} = useMemo(() => {
30+
return storeLocatorEnabled
31+
? groupShipmentsByDeliveryOption(order)
32+
: {pickupShipments: [], deliveryShipments: order?.shipments || []}
33+
}, [order?.shipments, storeLocatorEnabled])
3134

3235
const messages = defineMessages({
3336
pickupItems: {
@@ -40,16 +43,6 @@ const MultiShipOrderSummary = ({order, productItemsMap, currency}) => {
4043
}
4144
})
4245

43-
order.shipments.forEach((shipment) => {
44-
const isPickup = storeLocatorEnabled && isPickupShipment(shipment)
45-
46-
if (isPickup) {
47-
pickupShipments.push(shipment)
48-
} else {
49-
deliveryShipments.push(shipment)
50-
}
51-
})
52-
5346
// Group product items by shipment
5447
const getItemsForShipment = (shipmentId) => {
5548
return order.productItems.filter((item) => item.shipmentId === shipmentId)

packages/template-retail-react-app/app/mocks/mock-data.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5760,3 +5760,103 @@ export const mockBasketWithBonusProducts = {
57605760
],
57615761
total: 1
57625762
}
5763+
5764+
export const mockStore = {
5765+
data: [
5766+
{
5767+
id: '00001',
5768+
name: 'Downtown Store',
5769+
address1: '100 Market St',
5770+
city: 'San Francisco',
5771+
stateCode: 'CA',
5772+
postalCode: '94105',
5773+
phone: '(415) 555-0001'
5774+
}
5775+
]
5776+
}
5777+
5778+
export const mockMultiShipmentOrder = {
5779+
...mockOrderHistory.data[0],
5780+
orderNo: '00099003',
5781+
productItems: [
5782+
{
5783+
...mockOrderHistory.data[0].productItems[0],
5784+
shipmentId: 'pickup1',
5785+
itemId: 'item1'
5786+
},
5787+
{
5788+
...mockOrderHistory.data[0].productItems[1],
5789+
shipmentId: 'delivery1',
5790+
itemId: 'item2'
5791+
}
5792+
],
5793+
shipments: [
5794+
{
5795+
adjustedMerchandizeTotalTax: 1.5,
5796+
adjustedShippingTotalTax: 0,
5797+
gift: false,
5798+
merchandizeTotalTax: 1.5,
5799+
productSubTotal: 30.0,
5800+
productTotal: 30.0,
5801+
shipmentId: 'pickup1',
5802+
shipmentTotal: 30.0,
5803+
shippingAddress: {
5804+
address1: '100 Market St',
5805+
city: 'San Francisco',
5806+
countryCode: 'US',
5807+
firstName: 'Downtown Store',
5808+
fullName: 'Downtown Store',
5809+
id: 'pickup1addr',
5810+
lastName: 'pickup',
5811+
phone: '(415) 555-0001',
5812+
postalCode: '94105',
5813+
stateCode: 'CA'
5814+
},
5815+
shippingMethod: {
5816+
description: 'Pickup in store',
5817+
id: '005',
5818+
name: 'Store Pickup',
5819+
price: 0,
5820+
c_storePickupEnabled: true
5821+
},
5822+
shippingStatus: 'not_shipped',
5823+
shippingTotal: 0,
5824+
shippingTotalTax: 0,
5825+
taxTotal: 1.5,
5826+
c_fromStoreId: '00001'
5827+
},
5828+
{
5829+
adjustedMerchandizeTotalTax: 1.65,
5830+
adjustedShippingTotalTax: 0.3,
5831+
gift: false,
5832+
merchandizeTotalTax: 1.65,
5833+
productSubTotal: 32.98,
5834+
productTotal: 32.98,
5835+
shipmentId: 'delivery1',
5836+
shipmentTotal: 38.97,
5837+
shippingAddress: {
5838+
address1: '123 Main St',
5839+
city: 'Boston',
5840+
countryCode: 'US',
5841+
firstName: 'John',
5842+
fullName: 'John Doe',
5843+
id: 'delivery1addr',
5844+
lastName: 'Doe',
5845+
phone: '6175551234',
5846+
postalCode: '02101',
5847+
stateCode: 'MA'
5848+
},
5849+
shippingMethod: {
5850+
description: 'Order received within 7-10 business days',
5851+
id: '001',
5852+
name: 'Ground',
5853+
c_estimatedArrivalTime: '7-10 Business Days'
5854+
},
5855+
shippingStatus: 'not_shipped',
5856+
shippingTotal: 5.99,
5857+
shippingTotalTax: 0.3,
5858+
taxTotal: 1.95,
5859+
trackingNumber: 'TRACK123456'
5860+
}
5861+
]
5862+
}

0 commit comments

Comments
 (0)