feature/cart: display the variant name (cond)

This commit is contained in:
Zaiste 2021-06-09 18:23:49 +02:00
parent 0cf76d9a0c
commit 397ffc1c35
No known key found for this signature in database
GPG Key ID: 15DF7EBC7F2FFE35
3 changed files with 8 additions and 3 deletions

View File

@ -108,10 +108,14 @@ const CartItem = ({
<div className="flex-1 flex flex-col text-base">
<Link href={`/product/${item.path}`}>
<span
className="font-bold text-lg cursor-pointer leading-6"
onClick={() => closeSidebarIfPresent()}
>
{item.name}
<div
className="font-bold text-lg cursor-pointer leading-6"
>
{item.name}
</div>
{item.variant ? <span> {item.variant.name}</span> : ""}
</span>
</Link>
{options && options.length > 0 ? (

View File

@ -23,6 +23,7 @@ export const CheckoutDetails = /* GraphQL */ `
name
sku
product {
name
slug
}
media {

View File

@ -113,7 +113,7 @@ function normalizeLineItem({ id, variant, quantity }: CheckoutLine): LineItem {
id,
variantId: String(variant?.id),
productId: String(variant?.id),
name: `${variant.name}`,
name: `${variant.product.name}`,
quantity,
variant: {
id: String(variant?.id),