Skip to content

fix: cart totals showing subtotal instead of item_subtotal #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
4 changes: 3 additions & 1 deletion src/modules/common/components/cart-totals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from "react"
type CartTotalsProps = {
totals: {
total?: number | null
item_subtotal?: number | null
subtotal?: number | null
tax_total?: number | null
shipping_total?: number | null
Expand All @@ -21,6 +22,7 @@ const CartTotals: React.FC<CartTotalsProps> = ({ totals }) => {
currency_code,
total,
subtotal,
item_subtotal,
tax_total,
discount_total,
gift_card_total,
Expand All @@ -35,7 +37,7 @@ const CartTotals: React.FC<CartTotalsProps> = ({ totals }) => {
Subtotal (excl. shipping and taxes)
</span>
<span data-testid="cart-subtotal" data-value={subtotal || 0}>
{convertToLocale({ amount: subtotal ?? 0, currency_code })}
{convertToLocale({ amount: item_subtotal ?? 0, currency_code })}
</span>
</div>
{!!discount_total && (
Expand Down