From 30da2d088793cabfb3c5b21d4560df53187e7047 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 20 Feb 2024 16:30:43 +0700
Subject: Fix item url in cart item

---
 src-migrate/modules/cart/components/Item.tsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/cart/components/Item.tsx')

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>
       )}
-- 
cgit v1.2.3

