fix Detail page promotion price
This commit is contained in:
@@ -312,6 +312,10 @@ function Indicator({
|
||||
[listImages, selectedIndex, soldoutFlag]
|
||||
);
|
||||
|
||||
const savePrice = parseFloat(
|
||||
promotionPrcie?.discountAmount.replace(/[^0-9.-]+/g, "") || 0
|
||||
);
|
||||
|
||||
const renderThumbnail = useCallback(() => {
|
||||
return (
|
||||
<div className={css.thumbnailContainer}>
|
||||
@@ -346,25 +350,12 @@ function Indicator({
|
||||
<p className={css.badgeTitle}>{$L("Launch Event")}</p>
|
||||
<p className={css.badgeTitle}>{$L("Promo Code")}</p>
|
||||
<p className={css.badgeDate}>{promotionPrcie?.promotionDate}</p>
|
||||
{savePrice && (
|
||||
<h5>
|
||||
{(() => {
|
||||
const originalPrice = parseFloat(
|
||||
promotionPrcie?.originalPrice?.replace(
|
||||
/[^0-9.-]+/g,
|
||||
""
|
||||
) || 0
|
||||
);
|
||||
const discountedPrice = parseFloat(
|
||||
promotionPrcie?.discountedPrice?.replace(
|
||||
/[^0-9.-]+/g,
|
||||
""
|
||||
) || 0
|
||||
);
|
||||
const priceDifference = originalPrice - discountedPrice;
|
||||
return `$${priceDifference}`;
|
||||
})()}
|
||||
{`$${savePrice}`}
|
||||
<br /> <span>{$L("OFF")}</span>
|
||||
</h5>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</SpottableComponent>
|
||||
|
||||
Reference in New Issue
Block a user