Skip to content

Commit

Permalink
fix: fix product variant information in cart (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorzpokorski authored Oct 19, 2023
1 parent 8c41975 commit cff4bc7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/(main)/cart/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default async function Page() {
return (
<section className="mx-auto max-w-7xl p-8">
<h1 className="mt-8 text-3xl font-bold text-neutral-900">Your Shopping Cart</h1>

<form className="mt-12">
<div>
<ul role="list" className="divide-y divide-neutral-200 border-b border-t border-neutral-200">
Expand All @@ -36,24 +35,21 @@ export default async function Page() {
/>
)}
</div>

<div className="relative flex flex-1 flex-col justify-between p-4 py-2">
<div className="flex justify-between justify-items-start gap-4">
<div className="">
<Link href={`/products/${item.variant.product.slug}?variant=${item.variant.id}`}>
<h3 className="font-medium text-neutral-700">{item.variant?.product?.name}</h3>
</Link>
<p className="mt-1 text-sm text-neutral-500">{item.variant?.product?.category?.name}</p>
{Boolean(item.variant.name) && (
{item.variant.name !== item.variant.id && Boolean(item.variant.name) && (
<p className="mt-1 text-sm text-neutral-500">Variant: {item.variant.name}</p>
)}
</div>

<p className="text-right font-semibold text-neutral-900">
{formatMoney(item.totalPrice.gross.amount, item.totalPrice.gross.currency)}
</p>
</div>

<div className="flex justify-between">
<div className="text-sm font-bold">Qty: {item.quantity}</div>
<DeleteLineButton checkoutId={checkoutId} lineId={item.id} />
Expand All @@ -63,7 +59,6 @@ export default async function Page() {
))}
</ul>
</div>

<div className="mt-12">
<div className="rounded border bg-neutral-50 px-4 py-2">
<div className="flex items-center justify-between py-2">
Expand Down

0 comments on commit cff4bc7

Please sign in to comment.