Skip to content

Commit

Permalink
feat(core): add tax total in checkout summary (#731)
Browse files Browse the repository at this point in the history
* feat(core): add tax total in checkout summary

* fix: hide taxes if null
  • Loading branch information
jorgemoya committed Apr 4, 2024
1 parent 2524c67 commit 41ebe00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-balloons-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Add tax total in checkout summary
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export const CheckoutSummary = async ({ cartId, locale }: { cartId: string; loca
<span>-{currencyFormatter.format(checkout.cart?.discountedAmount.value || 0)}</span>
</div>

{checkout.taxTotal && (
<div className="flex justify-between border-t border-t-gray-200 py-4">
<span className="font-semibold">{t('tax')}</span>
<span>{currencyFormatter.format(checkout.taxTotal.value)}</span>
</div>
)}

<div className="flex justify-between border-t border-t-gray-200 py-4 text-xl font-bold lg:text-2xl">
{t('grandTotal')}
<span>{currencyFormatter.format(checkout.grandTotal?.value || 0)}</span>
Expand Down
1 change: 1 addition & 0 deletions apps/core/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"CheckoutSummary": {
"subTotal": "Subtotal",
"discounts": "Discounts",
"tax": "Tax",
"grandTotal": "Grand total",
"shipping": "Shipping",
"shippingCost": "Shipping Cost",
Expand Down

0 comments on commit 41ebe00

Please sign in to comment.