|
@@ -13,6 +13,7 @@ import ProductText from "./ProductText";
|
|
|
import NewUserBanner from "./NewUserBanner";
|
|
import NewUserBanner from "./NewUserBanner";
|
|
|
import PromotionDiscountCardProps from "./PromotionDiscountCardProps ";
|
|
import PromotionDiscountCardProps from "./PromotionDiscountCardProps ";
|
|
|
import Image from "next/image";
|
|
import Image from "next/image";
|
|
|
|
|
+import {useConfig} from "@/utils/hooks/useConfig";
|
|
|
import {
|
|
import {
|
|
|
isValueAvailable,
|
|
isValueAvailable,
|
|
|
isOptionValueAvailable,
|
|
isOptionValueAvailable,
|
|
@@ -29,12 +30,14 @@ export function ProductInformation({
|
|
|
productOptions,
|
|
productOptions,
|
|
|
flexibleVariants,
|
|
flexibleVariants,
|
|
|
isSaleable,
|
|
isSaleable,
|
|
|
|
|
+ shortDescription,
|
|
|
}: {
|
|
}: {
|
|
|
name: string;
|
|
name: string;
|
|
|
productId: number;
|
|
productId: number;
|
|
|
productOptions: ProductOption[];
|
|
productOptions: ProductOption[];
|
|
|
flexibleVariants: ResolvedVariant[];
|
|
flexibleVariants: ResolvedVariant[];
|
|
|
isSaleable: string | undefined;
|
|
isSaleable: string | undefined;
|
|
|
|
|
+ shortDescription:string;
|
|
|
}) {
|
|
}) {
|
|
|
const { isCartLoading, onAddToCart } = useAddProduct();
|
|
const { isCartLoading, onAddToCart } = useAddProduct();
|
|
|
const { showToast } = useCustomToast();
|
|
const { showToast } = useCustomToast();
|
|
@@ -234,7 +237,12 @@ export function ProductInformation({
|
|
|
addProductToCart("buynow");
|
|
addProductToCart("buynow");
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
- const currencySymbol = "$";
|
|
|
|
|
|
|
+ const {getCurrentCurrencyItem} = useConfig();
|
|
|
|
|
+ const currentCurrency = getCurrentCurrencyItem();
|
|
|
|
|
+ const currencySymbol = currentCurrency.symbol;
|
|
|
|
|
+ const currencyCode = currentCurrency.code;
|
|
|
|
|
+
|
|
|
|
|
+ // const currencySymbol = "$";
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
@@ -242,12 +250,12 @@ export function ProductInformation({
|
|
|
<h3 className="text-ly-14 text-black mt-4 leading-ly-22">
|
|
<h3 className="text-ly-14 text-black mt-4 leading-ly-22">
|
|
|
{name} {isSaleable}
|
|
{name} {isSaleable}
|
|
|
</h3>
|
|
</h3>
|
|
|
- <ProductText ProductText="" />
|
|
|
|
|
|
|
+ <ProductText ProductText={shortDescription} />
|
|
|
<div className="flex items-center mt-2">
|
|
<div className="flex items-center mt-2">
|
|
|
<Price
|
|
<Price
|
|
|
className="text-ly-16 leading-ly-24 font-bold"
|
|
className="text-ly-16 leading-ly-24 font-bold"
|
|
|
amount={String(currentVariantInfo.totalNowPrice)}
|
|
amount={String(currentVariantInfo.totalNowPrice)}
|
|
|
- currencyCode="USD"
|
|
|
|
|
|
|
+ currencyCode={currencyCode}
|
|
|
/>
|
|
/>
|
|
|
{currentVariantInfo.totalLinePrice !==
|
|
{currentVariantInfo.totalLinePrice !==
|
|
|
currentVariantInfo.totalNowPrice && (
|
|
currentVariantInfo.totalNowPrice && (
|
|
@@ -255,17 +263,17 @@ export function ProductInformation({
|
|
|
<Price
|
|
<Price
|
|
|
className="text-ly-12 leading-ly-20 text-ly-gray line-through ml-1"
|
|
className="text-ly-12 leading-ly-20 text-ly-gray line-through ml-1"
|
|
|
amount={String(currentVariantInfo.totalLinePrice)}
|
|
amount={String(currentVariantInfo.totalLinePrice)}
|
|
|
- currencyCode="USD"
|
|
|
|
|
|
|
+ currencyCode={currencyCode}
|
|
|
/>
|
|
/>
|
|
|
<Price
|
|
<Price
|
|
|
className="text-ly-12 leading-ly-20 text-ly-gray line-through ml-1"
|
|
className="text-ly-12 leading-ly-20 text-ly-gray line-through ml-1"
|
|
|
amount={String(currentVariantInfo.totalLinePrice)}
|
|
amount={String(currentVariantInfo.totalLinePrice)}
|
|
|
- currencyCode="USD"
|
|
|
|
|
|
|
+ currencyCode={currencyCode}
|
|
|
/>
|
|
/>
|
|
|
<Price
|
|
<Price
|
|
|
className="text-ly-12 leading-ly-16 bg-ly-gold pr-1.5 pl-1.5 ml-3"
|
|
className="text-ly-12 leading-ly-16 bg-ly-gold pr-1.5 pl-1.5 ml-3"
|
|
|
amount={String(currentVariantInfo.save)}
|
|
amount={String(currentVariantInfo.save)}
|
|
|
- currencyCode="USD"
|
|
|
|
|
|
|
+ currencyCode={currencyCode}
|
|
|
/>
|
|
/>
|
|
|
</>
|
|
</>
|
|
|
)}
|
|
)}
|
|
@@ -423,6 +431,7 @@ export function ProductInformation({
|
|
|
isLoading={isCartLoading}
|
|
isLoading={isCartLoading}
|
|
|
onAddToCart={addToCartHandler}
|
|
onAddToCart={addToCartHandler}
|
|
|
onBuyNow={buyNowHandler}
|
|
onBuyNow={buyNowHandler}
|
|
|
|
|
+ currencyCode={currencyCode}
|
|
|
priceInfo={{
|
|
priceInfo={{
|
|
|
totalNowPrice: currentVariantInfo.totalNowPrice,
|
|
totalNowPrice: currentVariantInfo.totalNowPrice,
|
|
|
totalLinePrice: currentVariantInfo.totalLinePrice,
|
|
totalLinePrice: currentVariantInfo.totalLinePrice,
|