mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Added name and price of the cart item
This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
import { Trash } from '@components/icon'
|
||||
import { useCommerce } from '@lib/bigcommerce'
|
||||
import formatVariantPrice from 'utils/format-item-price'
|
||||
|
||||
const CartItem = ({
|
||||
item,
|
||||
currencyCode,
|
||||
}: {
|
||||
item: any
|
||||
currencyCode: string
|
||||
}) => {
|
||||
const { locale } = useCommerce()
|
||||
const { price } = formatVariantPrice({
|
||||
listPrice: item.extended_list_price,
|
||||
salePrice: item.extended_sale_price,
|
||||
currencyCode,
|
||||
locale,
|
||||
})
|
||||
|
||||
console.log('ITEM', item)
|
||||
|
||||
const CartItem = () => {
|
||||
return (
|
||||
<li className="flex flex-row space-x-6">
|
||||
<div className="h-12 w-12 bg-violet"></div>
|
||||
<div className="flex-1 flex flex-col">
|
||||
<span>T-Shirt</span>
|
||||
<span>{item.name}</span>
|
||||
<div className="py-2">
|
||||
<span>-</span>
|
||||
<input
|
||||
@@ -16,7 +34,7 @@ const CartItem = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col space-y-2">
|
||||
<span>$50.00</span>
|
||||
<span>{price}</span>
|
||||
<span className="flex justify-end">
|
||||
<Trash />
|
||||
</span>
|
||||
|
Reference in New Issue
Block a user