Skip to content

Commit

Permalink
fix(core): show correct base price when sale is active in Cart (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoya committed May 17, 2024
1 parent e093e7c commit 321f67f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-items-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Fix incorrect sale price showing when no sale was active in Cart
12 changes: 10 additions & 2 deletions core/app/[locale]/(default)/cart/_components/cart-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const PhysicalItemFragment = graphql(`
currencyCode
value
}
listPrice {
currencyCode
value
}
selectedOptions {
__typename
entityId
Expand Down Expand Up @@ -79,6 +83,10 @@ const DigitalItemFragment = graphql(`
currencyCode
value
}
listPrice {
currencyCode
value
}
selectedOptions {
__typename
entityId
Expand Down Expand Up @@ -222,9 +230,9 @@ export const CartItem = async ({ currencyCode, product }: Props) => {
<div className="flex flex-col gap-2 md:items-end">
<div>
{product.originalPrice.value &&
product.originalPrice.value !== product.extendedSalePrice.value ? (
product.originalPrice.value !== product.listPrice.value ? (
<p className="text-lg font-bold line-through">
{format.number(product.originalPrice.value, {
{format.number(product.originalPrice.value * product.quantity, {
style: 'currency',
currency: currencyCode,
})}
Expand Down

0 comments on commit 321f67f

Please sign in to comment.