From c5b66564280fdc7d5fdc63133835adc803d6afd3 Mon Sep 17 00:00:00 2001 From: Reza Babaei Date: Sat, 18 Sep 2021 22:25:38 +0300 Subject: [PATCH] fix: bring back product price --- components/product/ProductCard/ProductCard.tsx | 14 +++++++------- .../product/{use-price.tsx.t => use-price.tsx} | 0 2 files changed, 7 insertions(+), 7 deletions(-) rename framework/woocommerce/product/{use-price.tsx.t => use-price.tsx} (100%) diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index 0e539160b..624a2ce5a 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -5,7 +5,7 @@ import type { Product } from '@commerce/types/product' import s from './ProductCard.module.css' import Image, { ImageProps } from 'next/image' import WishlistButton from '@components/wishlist/WishlistButton' -// import usePrice from '@framework/product/use-price' +import usePrice from '@framework/product/use-price' import ProductTag from '../ProductTag' interface Props { @@ -25,11 +25,11 @@ const ProductCard: FC = ({ noNameTag = false, variant = 'default', }) => { - // const { price } = usePrice({ - // amount: product.price.value, - // baseAmount: product.price.retailPrice, - // currencyCode: product.price.currencyCode!, - // }) + const { price } = usePrice({ + amount: product.price.value, + baseAmount: product.price.retailPrice, + currencyCode: product.price.currencyCode!, + }) const rootClassName = cn( s.root, @@ -74,7 +74,7 @@ const ProductCard: FC = ({ {product.name}
- {/* {`${price} ${product.price?.currencyCode}`} */} + {`${price} ${product.price?.currencyCode}`}
)} diff --git a/framework/woocommerce/product/use-price.tsx.t b/framework/woocommerce/product/use-price.tsx similarity index 100% rename from framework/woocommerce/product/use-price.tsx.t rename to framework/woocommerce/product/use-price.tsx