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"> <div className="flex-1 flex flex-col text-base">
<Link href={`/product/${item.path}`}> <Link href={`/product/${item.path}`}>
<span <span
className="font-bold text-lg cursor-pointer leading-6"
onClick={() => closeSidebarIfPresent()} onClick={() => closeSidebarIfPresent()}
>
<div
className="font-bold text-lg cursor-pointer leading-6"
> >
{item.name} {item.name}
</div>
{item.variant ? <span> {item.variant.name}</span> : ""}
</span> </span>
</Link> </Link>
{options && options.length > 0 ? ( {options && options.length > 0 ? (

View File

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

View File

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