x
This commit is contained in:
1 parent
992335a52b
commit
fb46bd71ed
10 files changed
+24
-18
No files matched your search
@@ -26,7 +26,7 @@ export default function ProductCard({ product, enableQuickShop = false, category
|
||||
const { i18n, t } = useTranslation();
|
||||
const isWished = isInWishlist(product.id);
|
||||
const [selectedVariant, setSelectedVariant] = useState(product.variants?.[0] || null);
|
||||
const displayName = resolveStr(product.name, i18n.language) || product.scent.name;
|
||||
const displayName = resolveStr(product.name, i18n.language) || (product.brand ? product.brand.name : '');
|
||||
const displayCategoryName = categoryNameOverride || resolveStr(product.category.name, i18n.language);
|
||||
|
||||
const handleWishlistClick = (e: React.MouseEvent) => {
|
||||
@@ -52,7 +52,7 @@ export default function ProductCard({ product, enableQuickShop = false, category
|
||||
<img
|
||||
src={product.images?.[0]?.url || getCategoryImage(displayCategoryName)}
|
||||
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-700"
|
||||
alt={product.scent.name}
|
||||
alt={displayName}
|
||||
onError={(e) => {
|
||||
(e.target as HTMLImageElement).style.display = 'none';
|
||||
}}
|
||||
@@ -100,7 +100,7 @@ export default function ProductCard({ product, enableQuickShop = false, category
|
||||
: 'border-pop-black/10 bg-transparent text-pop-black/70 hover:border-pop-black/30 hover:bg-pop-black/5'
|
||||
}`}
|
||||
>
|
||||
{variant.size}
|
||||
{[variant.option1, variant.option2, variant.option3].filter(Boolean).join(' / ')}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
@@ -131,7 +131,7 @@ export default function ProductCard({ product, enableQuickShop = false, category
|
||||
quantity: 1,
|
||||
price: selectedVariant.price || 0,
|
||||
productName: displayName,
|
||||
variantSize: selectedVariant.size,
|
||||
variantSize: [selectedVariant.option1, selectedVariant.option2, selectedVariant.option3].filter(Boolean).join(' / '),
|
||||
productImage: product.images?.[0]?.url || getCategoryImage(displayCategoryName)
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user