From 039165b57fe20f24ba0ef406ded60edb35929fe9 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 25 Oct 2023 09:54:51 +0700 Subject: bugs fix - brand undifine ketika kilik call for inquery (redirect ke wa) di product card --- src/lib/product/components/ProductCard.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 9500a3fd..71466259 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -12,6 +12,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { const callForPriceWhatsapp = whatsappUrl('product', { name: product.name, + manufacture: product.manufacture?.name, url: createSlug('/shop/product/', product.name, product.id, true) }) -- cgit v1.2.3 From 53c6be06b157761ce79ef4f0ce869d6f7c16682d Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 25 Oct 2023 10:01:49 +0700 Subject: set target blank --- src/lib/product/components/ProductCard.jsx | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 71466259..f7df29e2 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -103,7 +103,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {product?.lowestPrice.priceDiscount > 0 ? ( currencyFormat(product?.lowestPrice.priceDiscount) ) : ( - Call for Inquiry + + Call for Inquiry + )} @@ -118,7 +120,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { ) : ( - Call for Inquiry + + Call for Inquiry + )} )} @@ -126,7 +130,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.stockTotal > 0 &&
Ready Stock
} {/*
{product?.stockTotal > 5 ? '> 5' : '< 5'}
*/} - {product?.qtySold > 0 &&
{sellingProductFormat(product?.qtySold) + ' Terjual'}
} + {product?.qtySold > 0 && ( +
+ {sellingProductFormat(product?.qtySold) + ' Terjual'} +
+ )}
@@ -206,7 +214,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {product?.lowestPrice?.priceDiscount > 0 ? ( currencyFormat(product?.lowestPrice?.priceDiscount) ) : ( - Call for Inquiry + + Call for Inquiry + )} @@ -221,7 +231,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { ) : ( - Call for Inquiry + + Call for Inquiry + )} )} @@ -229,7 +241,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.stockTotal > 0 &&
Ready Stock
} {/*
{product?.stockTotal > 5 ? '> 5' : '< 5'}
*/} - {product?.qtySold > 0 &&
{sellingProductFormat(product?.qtySold) + ' Terjual'}
} + {product?.qtySold > 0 && ( +
+ {sellingProductFormat(product?.qtySold) + ' Terjual'} +
+ )}
-- cgit v1.2.3 From 4ea9fbdcdf1c6625204bbaea9c4b117febf0a212 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 13 Nov 2023 15:42:47 +0700 Subject: Fix showing pricelist price on product detail --- src/lib/product/components/Product/ProductDesktop.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index a8cca416..b3174483 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -441,7 +441,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { {sellingProductFormat(product?.qtySold) + ' Terjual'} )} - {lowestPrice?.isFlashsale && lowestPrice?.price.discountPercentage > 0 ? ( + {product?.flashSale?.id && lowestPrice?.price.discountPercentage > 0 ? ( <>
-- cgit v1.2.3 From 6ebe202147269100cd63ef125e877e8f693a27a1 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 17 Nov 2023 10:13:21 +0700 Subject: hotfix/round down discount precentage --- src/lib/product/components/Product/ProductDesktop.jsx | 4 ++-- src/lib/product/components/Product/ProductMobile.jsx | 2 +- src/lib/product/components/ProductCard.jsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index b3174483..5f034c09 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -445,7 +445,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { <>
- {lowestPrice?.price?.discountPercentage}% + {Math.floor(lowestPrice?.price?.discountPercentage)}%
{currencyFormat(lowestPrice?.price?.price)} @@ -584,7 +584,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { <>
- {variant?.price?.discountPercentage}% + {Math.floor(variant?.price?.discountPercentage)}%
{currencyFormat(variant?.price?.price)} diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index ef2c0002..e23e2fb9 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -260,7 +260,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { {activeVariant.isFlashsale && activeVariant?.price?.discountPercentage > 0 ? ( <>
-
{activeVariant?.price?.discountPercentage}%
+
{Math.floor(activeVariant?.price?.discountPercentage)}%
{currencyFormat(activeVariant?.price?.price)}
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index f7df29e2..fa555bcf 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -42,7 +42,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
- {product?.lowestPrice.discountPercentage}% + {Math.floor(product?.lowestPrice.discountPercentage)}%
-- cgit v1.2.3 From 87a004c0fcf256e1e92653767a630c01ad21ad5a Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Sat, 18 Nov 2023 11:33:28 +0700 Subject: add brand link di page search --- src/lib/product/components/ProductSearch.jsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index a4e9ecbb..29bb987e 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -20,6 +20,7 @@ import odooApi from '@/core/api/odooApi' import { formatCurrency } from '@/core/utils/formatValue' import axios from 'axios' import Skeleton from 'react-loading-skeleton' +import { createSlug } from '@/core/utils/slug' const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null }) => { const router = useRouter() @@ -87,13 +88,16 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null }) const brand = await axios( `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=search&q=${search}` ) + console.log('ini brand', brand) if (brand.data.length > 0) { setIsBrand(brand?.data[0]) } else { setIsBrand(null) } } - checkIfBrand() + if (router.pathname.includes('search')) { + checkIfBrand() + } }, [q]) const brands = [] @@ -362,11 +366,12 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null }) {isBrand && isBrand.logo && (

Brand Pencarian {q}

- + + +
)} -- cgit v1.2.3