summaryrefslogtreecommitdiff
path: root/src/lib/product
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-07 15:26:32 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-07 15:26:32 +0700
commit085dcb058ef4b92cea8b4044e65dd940580f3f42 (patch)
tree33b1895c552c801a53886c5a7a3329c9a1f848af /src/lib/product
parent9441fe06320c63c20f193babe5efd4da48de165e (diff)
<iman> merge all promotion
Diffstat (limited to 'src/lib/product')
-rw-r--r--src/lib/product/components/ProductCard.jsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 94db144d..35e2a665 100644
--- a/src/lib/product/components/ProductCard.jsx
+++ b/src/lib/product/components/ProductCard.jsx
@@ -17,8 +17,8 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
const [discount, setDiscount] = useState(0);
let voucherPastiHemat = 0;
-
- if (product?.voucherPastiHemat?.length > 0) {
+
+ if (product?.voucherPastiHemat ? product?.voucherPastiHemat.length : voucherPastiHemat > 0) {
const stringVoucher = product?.voucherPastiHemat[0];
const validJsonString = stringVoucher.replace(/'/g, '"');
voucherPastiHemat = JSON.parse(validJsonString);