Skip to content

Commit 613079d

Browse files
committed
Fix padding for total price
1 parent 5259c33 commit 613079d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/Cart/CartPage/CartItem.component.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useState } from 'react';
44
import { v4 as uuidv4 } from 'uuid';
55

66
import SVGX from 'components/SVG/SVGX.component';
7-
import { getUpdatedItems } from 'utils/functions/functions';
7+
import { getUpdatedItems, paddedPrice } from 'utils/functions/functions';
88

99
const CartItem = ({
1010
item,
@@ -14,6 +14,7 @@ const CartItem = ({
1414
updateCartProcessing,
1515
}) => {
1616
const [productCount, setProductCount] = useState(item.qty);
17+
const totalPrice = paddedPrice(item.totalPrice, 'kr');
1718

1819
/*
1920
* When user changes the quantity, update the cart in localStorage
@@ -81,8 +82,8 @@ const CartItem = ({
8182
</td>
8283
<td className="px-4 py-2 border">
8384
{'string' !== typeof item.totalPrice
84-
? item.totalPrice.toFixed(2)
85-
: item.totalPrice}
85+
? totalPrice.toFixed(2)
86+
: totalPrice}
8687
</td>
8788
</tr>
8889
);

0 commit comments

Comments
 (0)