diff options
Diffstat (limited to 'src-migrate')
| -rw-r--r-- | src-migrate/modules/cart/components/Item.tsx | 10 | ||||
| -rw-r--r-- | src-migrate/modules/cart/components/ItemPromo.tsx | 4 | ||||
| -rw-r--r-- | src-migrate/types/cart.ts | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index ba7f7cdf..d2bbdbdd 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -112,7 +112,10 @@ CartItem.Image = function CartItemImage({ item }: { item: CartItemProps }) { )} {item.cart_type === 'product' && ( - <Link href={createSlug('/shop/product/', item.name, item.id.toString())} className={style.image}> + <Link + href={createSlug('/shop/product/', item.parent.name, item.parent.id.toString())} + className={style.image} + > {image && <Image src={image} alt={item.name} width={128} height={128} />} {!image && <div className={style.noImage}>No Image</div>} </Link> @@ -129,7 +132,10 @@ CartItem.Name = function CartItemName({ item }: { item: CartItemProps }) { )} {item.cart_type === 'product' && ( - <Link href={createSlug('/shop/product/', item.name, item.id.toString())} className={style.name}> + <Link + href={createSlug('/shop/product/', item.parent.name, item.parent.id.toString())} + className={style.name} + > {item.name} </Link> )} diff --git a/src-migrate/modules/cart/components/ItemPromo.tsx b/src-migrate/modules/cart/components/ItemPromo.tsx index d355c82a..878e17ac 100644 --- a/src-migrate/modules/cart/components/ItemPromo.tsx +++ b/src-migrate/modules/cart/components/ItemPromo.tsx @@ -13,12 +13,12 @@ type Props = { const CartItemPromo = ({ product }: Props) => { return ( <div key={product.id} className={style.wrapper}> - <Link href={createSlug('/shop/product/', product.name, product.id.toString())} className={style.imageWrapper}> + <Link href={createSlug('/shop/product/', product.parent.name, product.parent.id.toString())} className={style.imageWrapper}> {product?.image && <Image src={product.image} alt={product.name} width={128} height={128} className={style.image} />} </Link> <div className={style.details}> - <Link href={createSlug('/shop/product/', product.name, product.id.toString())} className={style.name}> + <Link href={createSlug('/shop/product/', product.parent.name, product.parent.id.toString())} className={style.name}> {product.display_name} </Link> diff --git a/src-migrate/types/cart.ts b/src-migrate/types/cart.ts index 3aceeac4..5a2cf4a9 100644 --- a/src-migrate/types/cart.ts +++ b/src-migrate/types/cart.ts @@ -9,6 +9,10 @@ type Price = { export type CartProduct = { id: number; image: string; + parent: { + id: number; + name: string; + }; display_name: string; name: string; code: string; |
