From 01b0076c4e928e03b0337314a44690364983d1e5 Mon Sep 17 00:00:00 2001 From: Tharaa Elmorssi Date: Fri, 27 Feb 2026 06:59:58 +1100 Subject: [PATCH 1/2] fix(cart): Show backorder details for cart digital items --- core/app/[locale]/(default)/cart/page-data.ts | 6 ++ core/app/[locale]/(default)/cart/page.tsx | 69 +++++++++---------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/core/app/[locale]/(default)/cart/page-data.ts b/core/app/[locale]/(default)/cart/page-data.ts index c6e47636d..9c00df8d7 100644 --- a/core/app/[locale]/(default)/cart/page-data.ts +++ b/core/app/[locale]/(default)/cart/page-data.ts @@ -115,6 +115,12 @@ export const DigitalItemFragment = graphql(` } } url + stockPosition { + backorderMessage + quantityOnHand + quantityBackordered + quantityOutOfStock + } } `); diff --git a/core/app/[locale]/(default)/cart/page.tsx b/core/app/[locale]/(default)/cart/page.tsx index bc07f3d47..fd4111dea 100644 --- a/core/app/[locale]/(default)/cart/page.tsx +++ b/core/app/[locale]/(default)/cart/page.tsx @@ -127,43 +127,40 @@ export default async function Cart({ params }: Props) { let inventoryMessages; - if (item.__typename === 'CartPhysicalItem') { - if (item.stockPosition?.quantityOutOfStock === item.quantity) { - inventoryMessages = { - outOfStockMessage: data.site.settings?.inventory?.showOutOfStockMessage - ? data.site.settings.inventory.defaultOutOfStockMessage + if (item.stockPosition?.quantityOutOfStock === item.quantity) { + inventoryMessages = { + outOfStockMessage: data.site.settings?.inventory?.showOutOfStockMessage + ? data.site.settings.inventory.defaultOutOfStockMessage + : undefined, + }; + } else { + inventoryMessages = { + quantityReadyToShipMessage: + data.site.settings?.inventory?.showQuantityOnHand && !!item.stockPosition?.quantityOnHand + ? t('quantityReadyToShip', { + quantity: Number(item.stockPosition.quantityOnHand), + }) : undefined, - }; - } else { - inventoryMessages = { - quantityReadyToShipMessage: - data.site.settings?.inventory?.showQuantityOnHand && - !!item.stockPosition?.quantityOnHand - ? t('quantityReadyToShip', { - quantity: Number(item.stockPosition.quantityOnHand), - }) - : undefined, - quantityBackorderedMessage: - data.site.settings?.inventory?.showQuantityOnBackorder && - !!item.stockPosition?.quantityBackordered - ? t('quantityOnBackorder', { - quantity: Number(item.stockPosition.quantityBackordered), - }) - : undefined, - quantityOutOfStockMessage: - data.site.settings?.inventory?.showOutOfStockMessage && - !!item.stockPosition?.quantityOutOfStock - ? t('partiallyAvailable', { - quantity: item.quantity - Number(item.stockPosition.quantityOutOfStock), - }) - : undefined, - backorderMessage: - data.site.settings?.inventory?.showBackorderMessage && - !!item.stockPosition?.quantityBackordered - ? (item.stockPosition.backorderMessage ?? undefined) - : undefined, - }; - } + quantityBackorderedMessage: + data.site.settings?.inventory?.showQuantityOnBackorder && + !!item.stockPosition?.quantityBackordered + ? t('quantityOnBackorder', { + quantity: Number(item.stockPosition.quantityBackordered), + }) + : undefined, + quantityOutOfStockMessage: + data.site.settings?.inventory?.showOutOfStockMessage && + !!item.stockPosition?.quantityOutOfStock + ? t('partiallyAvailable', { + quantity: item.quantity - Number(item.stockPosition.quantityOutOfStock), + }) + : undefined, + backorderMessage: + data.site.settings?.inventory?.showBackorderMessage && + !!item.stockPosition?.quantityBackordered + ? (item.stockPosition.backorderMessage ?? undefined) + : undefined, + }; } return { From 6361783f0efb65cb7cec020be61177cc15fb49c5 Mon Sep 17 00:00:00 2001 From: Tharaa <36555311+Tharaae@users.noreply.github.com> Date: Fri, 27 Feb 2026 08:51:22 +1100 Subject: [PATCH 2/2] Update backorder details message for digital items For existing Catalyst stores, to apply this fix, rebase the existing code with the new release code, specifically for the mentioned files. --- .changeset/rotten-vans-train.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/rotten-vans-train.md diff --git a/.changeset/rotten-vans-train.md b/.changeset/rotten-vans-train.md new file mode 100644 index 000000000..d112379b3 --- /dev/null +++ b/.changeset/rotten-vans-train.md @@ -0,0 +1,10 @@ +--- +"@bigcommerce/catalyst-core": patch +--- + +Show backorder details for digital items on cart page + +## Migration +For existing Catalyst stores, to this fix, simply rebase the existing code with the new release code. The files to be rebased for this change to be applied are: +- core/app/[locale]/(default)/cart/page-data.ts +- core/app/[locale]/(default)/cart/page.tsx