Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/template-retail-react-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- Add support for environment level base paths on /mobify routes [#2892](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2892)
- Fix private client endpoint prop name [#3177](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3177)
- This feature introduces an AI-powered shopping assistant that integrates Salesforce Embedded Messaging Service with PWA Kit applications. The shopper agent provides real-time chat support, search assistance, and personalized shopping guidance directly within the e-commerce experience. [#2658](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2658)
- Added support for Multi-Ship [#3056](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3056) [#3199](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3199) [#3203](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3203) [#3211] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3211) [#3217](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3217) [#3216] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3216) [#3231] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3231)
- Added support for Multi-Ship [#3056](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3056) [#3199](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3199) [#3203](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3203) [#3211] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3211) [#3217](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3217) [#3216] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3216) [#3231] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3231) [#3240] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3240)
- The feature toggle for partial hydration is now found in the config file (`config.app.partialHydrationEnabled`) [#3058](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3058)
- Mask user not found messages to prevent user enumeration from passwordless login [#3113](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3113)
- [Bugfix] Pin `@chakra-ui/react` version to 2.7.0 to avoid breaking changes from 2.10.9 [#2658](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2658)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,7 @@ export default function ShippingMethods() {
// Multiple shipments summary
<Stack spacing={2}>
{deliveryShipments.map((shipment) => {
const shippingItem = basket?.shippingItems?.find(
(item) => item.shipmentId === shipment.shipmentId
)
const itemCost =
shippingItem?.priceAfterItemDiscount !== undefined
? shippingItem.priceAfterItemDiscount
: shippingItem?.price || 0
const itemCost = shipment.shippingTotal || 0
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the different between basket and shipment, and why is checking priceAfterItemDiscount no longer necessary?

Copy link
Contributor Author

@sf-henry-semaganda sf-henry-semaganda Sep 3, 2025

Choose a reason for hiding this comment

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

@sf-emmyzhang
let me try to explain,
summary showed incorrect individual shipping costs that didn't match the total.
Code uses Array.find() on shippingItems which only returned the first shipping item per shipment, ignoring surcharges and additional fees.
Example:
Displayed: £5.99 and £5.99 (no promotion applied and not valid for promotion)

but it is possible to have a surcharge or other fees i.e £10.00 surcharge on first shipment

So Actual would be: £15.99 + £5.99 = £21.98, - which is not the case.

Fix is to use shipment.shippingTotal instead of parsing shippingItems array, shipment.shippingTotal has the priceAfterDiscount and other fees baked in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, thanks for explaining!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sf-emmyzhang also just realized I never answered part of your qn
Basket - the entire shopping cart/order container - contains all products, all shipments, totals, customer info, etc.
Shipment - single delivery destination/address; contains products going to one address, shipping method, address info

return (
<Box key={shipment.shipmentId}>
<Flex justify="space-between" w="full">
Expand Down
Loading