From 562f5c23badaeb8640236de38193dccf38d6d1ed Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 22 Sep 2023 16:43:11 +0700 Subject: update variant --- src/lib/product/components/Product/ProductDesktopVariant.jsx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx index 940ba46f..df294df5 100644 --- a/src/lib/product/components/Product/ProductDesktopVariant.jsx +++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx @@ -17,6 +17,7 @@ import whatsappUrl from '@/core/utils/whatsappUrl' import useAuth from '@/core/hooks/useAuth' import odooApi from '@/core/api/odooApi' import { Button, Spinner } from 'flowbite-react' +import { useProductCartContext } from '@/contexts/ProductCartContext' const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant }) => { const router = useRouter() @@ -28,6 +29,8 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant }) const [addCartAlert, setAddCartAlert] = useState(false) const [isLoadingSLA, setIsLoadingSLA] = useState(true) + const {setRefreshCart} = useProductCartContext() + const getLowestPrice = useCallback(() => { const lowest = product.price /* const lowest = prices.reduce((lowest, price) => { @@ -72,6 +75,7 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant }) selected: true, source: null }) + setRefreshCart(true) setAddCartAlert(true) } -- cgit v1.2.3 From 48cd6983f253319940cb27b2fbbb14eb597253a6 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 25 Sep 2023 09:21:33 +0700 Subject: add update cart di page variant product --- src/lib/product/components/Product/ProductDesktopVariant.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx index df294df5..3ed68ba3 100644 --- a/src/lib/product/components/Product/ProductDesktopVariant.jsx +++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx @@ -29,7 +29,7 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant }) const [addCartAlert, setAddCartAlert] = useState(false) const [isLoadingSLA, setIsLoadingSLA] = useState(true) - const {setRefreshCart} = useProductCartContext() + const { setRefreshCart } = useProductCartContext() const getLowestPrice = useCallback(() => { const lowest = product.price @@ -74,8 +74,9 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant }) programLineId: null, selected: true, source: null + }).then(() => { + setRefreshCart(true) }) - setRefreshCart(true) setAddCartAlert(true) } -- cgit v1.2.3 From 2471cde6bdfbcc3bbc76f26656fdc79bd1f6bdb1 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 26 Sep 2023 09:33:01 +0700 Subject: Update Image component with next image --- src/lib/product/components/ProductSlider.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/ProductSlider.jsx b/src/lib/product/components/ProductSlider.jsx index dedbd6ab..2f8101b0 100644 --- a/src/lib/product/components/ProductSlider.jsx +++ b/src/lib/product/components/ProductSlider.jsx @@ -10,7 +10,7 @@ import MobileView from '@/core/components/views/MobileView' import DesktopView from '@/core/components/views/DesktopView' const bannerClassName = - 'absolute rounded-r top-0 left-0 h-full w-auto md:w-[20%] idt-transition border border-gray_r-6' + 'absolute rounded-r top-0 left-0 h-full w-auto md:w-[20%] border border-gray_r-6' const ProductSlider = ({ products, simpleTitle = false, bannerMode = false }) => { const bannerRef = useRef('') @@ -52,6 +52,7 @@ const ProductSlider = ({ products, simpleTitle = false, bannerMode = false }) => {bannerMode && (
{products.banner.name} Date: Tue, 26 Sep 2023 10:10:35 +0700 Subject: Revert Image with Next Image to React Lazy Load --- src/lib/product/components/ProductSlider.jsx | 1 - 1 file changed, 1 deletion(-) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/ProductSlider.jsx b/src/lib/product/components/ProductSlider.jsx index 2f8101b0..54f209cc 100644 --- a/src/lib/product/components/ProductSlider.jsx +++ b/src/lib/product/components/ProductSlider.jsx @@ -52,7 +52,6 @@ const ProductSlider = ({ products, simpleTitle = false, bannerMode = false }) => {bannerMode && (
{products.banner.name} Date: Wed, 27 Sep 2023 14:05:15 +0700 Subject: Update with chakra UI theme --- src/lib/product/components/Product/ColumnsSLA.jsx | 89 ++++------- .../product/components/Product/ProductDesktop.jsx | 98 +++++------- .../components/Product/ProductDesktopVariant.jsx | 88 ++++------- .../product/components/Product/ProductMobile.jsx | 1 - .../components/Product/ProductMobileVariant.jsx | 11 +- .../product/components/ProductFilterDesktop.jsx | 165 ++++++++++++--------- src/lib/product/components/ProductSearch.jsx | 8 +- 7 files changed, 199 insertions(+), 261 deletions(-) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/Product/ColumnsSLA.jsx b/src/lib/product/components/Product/ColumnsSLA.jsx index 33da703a..e5296f96 100644 --- a/src/lib/product/components/Product/ColumnsSLA.jsx +++ b/src/lib/product/components/Product/ColumnsSLA.jsx @@ -1,8 +1,9 @@ import odooApi from '@/core/api/odooApi' import { createSlug } from '@/core/utils/slug' import whatsappUrl from '@/core/utils/whatsappUrl' -import { Button, Spinner } from 'flowbite-react' -import { memo, useEffect, useState } from 'react' +import { Box, Skeleton, Tooltip } from '@chakra-ui/react' +import { Info } from 'lucide-react' +import { memo } from 'react' import { useQuery } from 'react-query' const ColumnSLA = ({ variant, product }) => { @@ -12,67 +13,35 @@ const ColumnSLA = ({ variant, product }) => { return ( <> - {dataSLA.isFetching ? ( -
- -
- ) : dataSLA?.data?.qty > 0 ? ( - dataSLA?.data?.qty - ) : ( - - Tanya Admin - - )} + + {dataSLA?.data?.qty > 0 ? ( + dataSLA?.data?.qty + ) : ( + + Tanya Admin + + )} + + - {dataSLA.isFetching ? ( - - ) : dataSLA?.data?.slaDate != '-' ? ( - - ) : ( - '-' - )} + + + + ) diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 6da289bc..5cc35df7 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -15,7 +15,6 @@ import ProductCard from '../ProductCard' import productSimilarApi from '../../api/productSimilarApi' import whatsappUrl from '@/core/utils/whatsappUrl' import odooApi from '@/core/api/odooApi' -import { Button, Spinner } from 'flowbite-react' import PromotionType from '@/lib/promotinProgram/components/PromotionType' import useAuth from '@/core/hooks/useAuth' import ImageNext from 'next/image' @@ -23,6 +22,8 @@ import CountDown2 from '@/core/components/elements/CountDown/CountDown2' import { LazyLoadComponent } from 'react-lazy-load-image-component' import ColumnsSLA from './ColumnsSLA' import { useProductCartContext } from '@/contexts/ProductCartContext' +import { Box, Skeleton, Tooltip } from '@chakra-ui/react' +import { Info } from 'lucide-react' const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { const router = useRouter() @@ -40,7 +41,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { const [selectVariantPromoActive, setSelectVariantPromoActive] = useState(null) const [backgorundFlashSale, setBackgorundFlashSale] = useState(null) - const {setRefreshCart , refreshCart} = useProductCartContext() + const { setRefreshCart, refreshCart } = useProductCartContext() const getLowestPrice = useCallback(() => { const prices = product.variants.map((variant) => variant.price) @@ -256,16 +257,16 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {

{product?.name}

-
Nomor SKU
-
SKU-{product.id}
+
Nomor SKU
+
SKU-{product.id}
-
Part Number
-
{product.code || '-'}
+
Part Number
+
{product.code || '-'}
-
Manufacture
-
+
Manufacture
+
{product.manufacture?.name ? ( {
-
Persiapan Barang
-
- {product.variants.length > 1 ? ( +
Persiapan Barang
+
+ {product.variants.length > 1 && ( - ) : product.variants[0].sla ? ( - product.variants[0].sla?.slaDate != '-' ? ( - - ) : ( - '-' - ) - ) : ( - + + {product.variants[0]?.sla?.slaDate} + + + + )} + )}
+ {product.variants.length === 1 && (
-
Stock
-
- {isLoadingSLA && ( -
- -
- )} +
Stock
+
+ {!product.variants[0]?.sla && } {product?.variants[0].sla?.qty > 0 && ( {product?.variants[0].sla?.qty} )} @@ -366,9 +337,10 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
)} +
1 ? '' : 'bg-gray_r-4'} `}> -
Berat Barang
-
+
Berat Barang
+
{product?.weight > 0 && {product?.weight} KG} {product?.weight == 0 && ( { const router = useRouter() @@ -149,16 +150,16 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })

{product?.name}

-
Nomor SKU
-
SKU-{product.id}
+
Nomor SKU
+
SKU-{product.id}
-
Part Number
-
{product.code || '-'}
+
Part Number
+
{product.code || '-'}
-
Manufacture
-
+
Manufacture
+
{product.manufacture?.name ? (
+
-
Persiapan Barang
-
- {product.sla ? ( - product.sla?.slaDate != '-' ? ( - - ) : ( - '-' - ) - ) : ( - +
Persiapan Barang
+
+ {!product?.sla && } + {product?.sla && ( + + + {product?.sla?.slaDate} + + + )}
+
-
Stock
-
- {isLoadingSLA && ( -
- -
- )} +
Stock
+
-
Berat Barang
-
+
Berat Barang
+
- ): ( + ) : ( '-' )} diff --git a/src/lib/product/components/ProductFilterDesktop.jsx b/src/lib/product/components/ProductFilterDesktop.jsx index ce6c12ed..b64349c7 100644 --- a/src/lib/product/components/ProductFilterDesktop.jsx +++ b/src/lib/product/components/ProductFilterDesktop.jsx @@ -2,7 +2,21 @@ import { useRouter } from 'next/router' import { useState } from 'react' import _ from 'lodash' import { toQuery } from 'lodash-contrib' -import { Accordion, Checkbox, Label, TextInput } from 'flowbite-react' +import { + Accordion, + AccordionButton, + AccordionIcon, + AccordionItem, + AccordionPanel, + Box, + Button, + Checkbox, + Input, + InputGroup, + InputLeftAddon, + Stack, + VStack +} from '@chakra-ui/react' const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = null }) => { const router = useRouter() @@ -13,7 +27,7 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu const [priceFrom, setPriceFrom] = useState(query?.priceFrom) const [priceTo, setPriceTo] = useState(query?.priceTo) - const handleCategorysChange = (event) => { + const handleCategoriesChange = (event) => { const value = event.target.value const isChecked = event.target.checked if (isChecked) { @@ -48,80 +62,95 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu return ( <> - - - Kategori - -
+ + + + + Brand + + + + + + + {brands.map((brand, index) => ( +
+ + {brand} + +
+ ))} +
+
+
+ + + + + Kategori + + + + + + {categories.map((category, index) => (
- +
))} -
-
-
- - {!defaultBrand && ( - <> - Brand - -
- {brands.map((brand, index) => ( -
- - -
- ))} -
-
- - )} -
- - Harga - -
- setPriceFrom(e.target.value)} - /> -
-
- setPriceTo(e.target.value)} - /> -
-
-
+ + + + + + + + Harga + + + + + + + + Rp + setPriceFrom(e.target.value)} + /> + + + Rp + setPriceTo(e.target.value)} + /> + + + +
-
- -
+ + ) } diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index ae9618d2..df9aa91b 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -39,9 +39,11 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { const oddIndexSuggestions = response.data.spellcheck.suggestions.filter( (_, index) => index % 2 === 1 ) + const oddIndexCollations = response.data.spellcheck.collations.filter( (_, index) => index % 2 === 1 ) + const dataSpellings = oddIndexSuggestions.reduce((acc, curr) => { oddIndexCollations.forEach((collation) => { acc.push(collation.collationQuery) @@ -52,7 +54,9 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { return acc }, []) - setQ(dataSpellings[0]) + if (dataSpellings.length > 0) { + setQ(dataSpellings[0]) + } setSpellings(dataSpellings) }) @@ -183,7 +187,7 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { defaultBrand={defaultBrand} />
-
+

Hasil Pencarian

-- cgit v1.2.3 From bdfaa0b8564e89d72ffd2de93eb088e8cf0db31e Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 2 Oct 2023 17:07:20 +0700 Subject: mapping new pricelist --- src/lib/product/components/ProductCard.jsx | 43 +++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 10ffdaec..83b26449 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -89,23 +89,40 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { > {product?.name} - {product?.lowestPrice.discountPercentage > 0 && ( -
-
- {currencyFormat(product.lowestPrice.price)} + {product?.flashSale?.id > 0 ? ( + <> + {product?.lowestPrice.discountPercentage > 0 && ( +
+
+ {currencyFormat(product.lowestPrice.price)} +
+
{product?.lowestPrice.discountPercentage}%
+
+ )} + +
-
{product?.lowestPrice.discountPercentage}%
+ + ) : ( +
+ {product?.lowestPrice.price > 0 ? ( + <> + {currencyFormat(product?.lowestPrice.price)} +
+ Incl {currencyFormat(product.lowestPrice.price * process.env.NEXT_PUBLIC_PPN )} +
+ + ) : ( + Call for price + )}
)} -
- {product?.lowestPrice.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice.priceDiscount) - ) : ( - Call for price - )} -
- {product?.stockTotal > 0 && (
Ready Stock
-- cgit v1.2.3 From 787d3aaa3187d3432c8e6b743b555ea3e4a4980c Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 3 Oct 2023 15:25:14 +0700 Subject: new pricelist di page product cart, product detail & product variant --- .../product/components/Product/ProductDesktop.jsx | 74 +++++++++++++++------- .../components/Product/ProductDesktopVariant.jsx | 71 ++++++++++++--------- .../product/components/Product/ProductMobile.jsx | 69 ++++++++++++-------- .../components/Product/ProductMobileVariant.jsx | 73 +++++++++++---------- src/lib/product/components/ProductCard.jsx | 50 ++++++++++----- 5 files changed, 205 insertions(+), 132 deletions(-) (limited to 'src/lib/product/components') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 5cc35df7..0df60673 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -413,13 +413,13 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
Harga mulai dari:
)} - {lowestPrice?.discountPercentage > 0 && ( + {/* {lowestPrice?.discountPercentage > 0 && (
{lowestPrice?.discountPercentage}%
-
- {currencyFormat(lowestPrice?.price)} +
+ Include PPN {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)}
{product.flashSale.remainingTime > 0 && (
@@ -436,28 +436,54 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
)}
+ )} */} + + {product?.flashSale?.remainingTime > 0 ? ( + <> +
+
+ {lowestPrice?.discountPercentage}% +
+
+ {currencyFormat(lowestPrice?.price)} +
+
+ {currencyFormat(lowestPrice?.priceDiscount)} +
+
+
+ Termasuk PPN: {currencyFormat(lowestPrice?.priceDiscount * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( +

+ {lowestPrice?.price > 0 ? ( + <> + {currencyFormat(lowestPrice?.price)} +
+ Termasuk PPN: {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( + + Hubungi kami untuk dapatkan harga terbaik,  + + klik disini + + + )} +

)} -

- {lowestPrice?.priceDiscount > 0 ? ( - currencyFormat(lowestPrice?.priceDiscount) - ) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - - )} -

+ {product.variants.length > 1 ? (
*/}
- {lowestPrice?.priceDiscount > 0 ? ( + {product?.flashSale?.remainingTime > 0 ? ( <> -
-
- Harga Sebelum PPN : -
-
- - {currencyFormat(lowestPrice?.priceDiscount)} - -
-
- Termasuk PPN : -
+
{lowestPrice?.discountPercentage}%
-
- {currencyFormat(lowestPrice?.price * 1.11)} +
+ {currencyFormat(lowestPrice?.price)}
-

- {currencyFormat(lowestPrice?.priceDiscount * 1.11)} -

+
+ {currencyFormat(lowestPrice?.priceDiscount)} +
+
+
+ Termasuk PPN:{' '} + {currencyFormat(lowestPrice?.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - +

+ {lowestPrice?.price > 0 ? ( + <> + {currencyFormat(lowestPrice?.price)} +
+ Termasuk PPN:{' '} + {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( + + Hubungi kami untuk dapatkan harga terbaik,  + + klik disini + + + )} +

)}
{ price: variant.price, stock: variant.stock, weight: variant.weight, - hasProgram: variant.hasProgram + hasProgram: variant.hasProgram, + isFlashsale: variant.isFlashsale } setActiveVariant(newActiveVariant) @@ -151,6 +152,8 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { router.push(`/shop/checkout?source=buy`) } + console.log('ini log', activeVariant) + const productSimilarQuery = [ product?.name, `fq=-product_id_i:${product.id}`, @@ -231,32 +234,48 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
Harga mulai dari:
)} - {activeVariant?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(activeVariant?.price?.price)} + {activeVariant.isFlashsale ? ( + <> +
+
{activeVariant?.price?.discountPercentage}%
+
+ {currencyFormat(activeVariant?.price?.price)} +
+
+ {currencyFormat(activeVariant?.price?.priceDiscount)} +
-
{activeVariant?.price?.discountPercentage}%
-
+
+ Termasuk PPN:{' '} + {currencyFormat(activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( +

+ {activeVariant?.price?.priceDiscount > 0 ? ( + <> + {currencyFormat(activeVariant?.price?.priceDiscount)} +
+ Termasuk PPN:{' '} + {currencyFormat(activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( + + Hubungi kami untuk dapatkan harga terbaik,  + + klik disini + + + )} +

)} -

- {activeVariant?.price?.priceDiscount > 0 ? ( - currencyFormat(activeVariant?.price?.priceDiscount) - ) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - - )} -

diff --git a/src/lib/product/components/Product/ProductMobileVariant.jsx b/src/lib/product/components/Product/ProductMobileVariant.jsx index d0c209cc..a7b1a543 100644 --- a/src/lib/product/components/Product/ProductMobileVariant.jsx +++ b/src/lib/product/components/Product/ProductMobileVariant.jsx @@ -39,7 +39,8 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { name: product.name, price: getLowestPrice(), stock: product.stockTotal, - weight: product.weight + weight: product.weight, + isFlashSale: product.isFlashsale }) useEffect(() => { @@ -50,7 +51,8 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { name: product.name, price: product.price, stock: product.stock, - weight: product.weight + weight: product.weight, + isFlashSale: product.isFlashsale }) } }, [selectedVariant, product]) @@ -80,6 +82,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { }) setAddCartAlert(true) } + console.log('ini log', activeVariant) const handleClickBuy = () => { if (!validAction()) return @@ -139,47 +142,47 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {

{activeVariant?.name}

- {activeVariant?.price?.priceDiscount > 0 ? ( + {activeVariant.isFlashsale ? ( <>
-
Harga Sebelum PPN :
-
- {' '} +
{activeVariant?.price?.discountPercentage}%
+
+ {currencyFormat(activeVariant?.price?.price)} +
+
{currencyFormat(activeVariant?.price?.priceDiscount)}
-
- Termasuk PPN : -
- {activeVariant?.price?.discountPercentage > 0 && ( - <> -
- {activeVariant?.price?.discountPercentage}% -
-
- {currencyFormat(activeVariant?.price?.price * 1.11)} -
- - )} -

- {currencyFormat(activeVariant?.price?.priceDiscount * 1.11)} -

-
+
+ Termasuk PPN:{' '} + {currencyFormat(activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - +

+ {activeVariant?.price?.priceDiscount > 0 ? ( + <> + {currencyFormat(activeVariant?.price?.priceDiscount)} +
+ Termasuk PPN:{' '} + {currencyFormat(activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( + + Hubungi kami untuk dapatkan harga terbaik,  + + klik disini + + + )} +

)}
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 83b26449..16c63c00 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -82,7 +82,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} { {product?.lowestPrice.price > 0 ? ( <> {currencyFormat(product?.lowestPrice.price)} -
- Incl {currencyFormat(product.lowestPrice.price * process.env.NEXT_PUBLIC_PPN )} +
+ + PPN: {currencyFormat(product.lowestPrice.price * process.env.NEXT_PUBLIC_PPN)}
) : ( @@ -186,30 +186,46 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {product?.name} + {product?.flashSale?.id > 0 ? ( + <> + {product?.lowestPrice.discountPercentage > 0 && ( +
+
{product?.lowestPrice?.discountPercentage}%
+
+ {currencyFormat(product?.lowestPrice?.price)} +
+
+ )} - {product?.lowestPrice?.discountPercentage > 0 && ( -
-
{product?.lowestPrice?.discountPercentage}%
-
- {currencyFormat(product?.lowestPrice?.price)} +
+ {product?.lowestPrice?.priceDiscount > 0 ? ( + currencyFormat(product?.lowestPrice?.priceDiscount) + ) : ( + Call for price + )}
+ + ) : ( +
+ {product?.lowestPrice.price > 0 ? ( + <> + {currencyFormat(product?.lowestPrice.price)} +
+ + PPN: {currencyFormat(product.lowestPrice.price * process.env.NEXT_PUBLIC_PPN)} +
+ + ) : ( + Call for price + )}
)} -
- {product?.lowestPrice?.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice?.priceDiscount) - ) : ( - Call for price - )} -
- {product?.stockTotal > 0 && (
Ready Stock
-- cgit v1.2.3