From 22a13e2a115dc76fda0f72efbec57f39055af2a3 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 18 Nov 2024 08:27:26 +0700 Subject: fix code no data search --- src/lib/flashSale/components/FlashSale.jsx | 2 +- src/lib/flashSale/components/FlashSaleNonDisplay.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/flashSale/components/FlashSale.jsx b/src/lib/flashSale/components/FlashSale.jsx index 89c46de4..8be1d7a6 100644 --- a/src/lib/flashSale/components/FlashSale.jsx +++ b/src/lib/flashSale/components/FlashSale.jsx @@ -69,7 +69,7 @@ const FlashSaleProduct = ({ flashSaleId }) => { useEffect(() => { const loadProducts = async () => { const dataProducts = await productSearchApi({ - query: `fq=flashsale_id_i:${flashSaleId}&fq=flashsale_price_f:[1 TO *]&limit=500&orderBy=flashsale-price-asc`, + query: `fq=flashsale_id_i:${flashSaleId}&fq=flashsale_price_f:[1 TO *]&limit=500&orderBy=flashsale-price-asc&source=similar`, operation: 'AND', }); setProducts(dataProducts.response); diff --git a/src/lib/flashSale/components/FlashSaleNonDisplay.jsx b/src/lib/flashSale/components/FlashSaleNonDisplay.jsx index c91de2be..4b420fac 100644 --- a/src/lib/flashSale/components/FlashSaleNonDisplay.jsx +++ b/src/lib/flashSale/components/FlashSaleNonDisplay.jsx @@ -56,7 +56,7 @@ const FlashSaleProduct = ({ flashSaleId }) => { useEffect(() => { const loadProducts = async () => { const dataProducts = await productSearchApi({ - query: `fq=-flashsale_id_i:${flashSaleId}&fq=flashsale_price_f:[1 TO *]&limit=25&orderBy=flashsale-discount-desc`, + query: `fq=-flashsale_id_i:${flashSaleId}&fq=flashsale_price_f:[1 TO *]&limit=25&orderBy=flashsale-discount-desc&source=similar`, operation: 'AND', }); setProducts(dataProducts.response); -- cgit v1.2.3 From ee02e383573a901f2da1206c4b59307a8d0c597e Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 18 Nov 2024 10:35:52 +0700 Subject: bugs fix search category dinamis --- src/lib/product/components/ProductSearch.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index f7b044aa..a6d8a7d6 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -114,7 +114,7 @@ const ProductSearch = ({ if (prefixUrl.includes('category')) { const ids = collectIds(dataCategoriesProduct); const newQuery = { - fq: `category_id_ids:(${ids.join(' OR ')})`, + fq: [`category_id_ids:(${ids.join(' OR ')})`], page: router.query.page ? router.query.page : 1, brand: router.query.brand ? router.query.brand : '', category: router.query.category ? router.query.category : '', -- cgit v1.2.3 From 31b0c79103bc32e7c7aa30c6d96c896b094c2bb2 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 18 Nov 2024 10:56:27 +0700 Subject: ketinggalan --- src/lib/product/components/ProductSearch.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index a6d8a7d6..f7b044aa 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -114,7 +114,7 @@ const ProductSearch = ({ if (prefixUrl.includes('category')) { const ids = collectIds(dataCategoriesProduct); const newQuery = { - fq: [`category_id_ids:(${ids.join(' OR ')})`], + fq: `category_id_ids:(${ids.join(' OR ')})`, page: router.query.page ? router.query.page : 1, brand: router.query.brand ? router.query.brand : '', category: router.query.category ? router.query.category : '', -- cgit v1.2.3 From ab35d72d65501251f579adf210051e2847cad41b Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 18 Nov 2024 10:59:40 +0700 Subject: CR gtag user_data on page checkout --- src/lib/checkout/components/Checkout.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index afbf1e6c..4c5cca62 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -37,6 +37,18 @@ const SELF_PICKUP_ID = 32; const { checkoutApi } = require('../api/checkoutApi'); const { getProductsCheckout } = require('../api/checkoutApi'); +function convertToInternational(number) { + if (typeof number !== 'string') { + throw new Error("Input harus berupa string"); + } + + if (number.startsWith('08')) { + return '+62' + number.slice(2); + } + + return number; +} + const Checkout = () => { const router = useRouter(); const query = router.query.source ?? null; @@ -491,7 +503,7 @@ const Checkout = () => { gtag('set', 'user_data', { email: auth.email, - phone_number: auth.mobile ?? auth.phone, + phone_number: convertToInternational(auth.mobile) ?? convertToInternational(auth.phone), }); for (const product of products) deleteItemCart({ productId: product.id }); -- cgit v1.2.3 From bde516b6b39cccfe8ac3248cd7f85592e6298d7a Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 18 Nov 2024 11:24:56 +0700 Subject: add google tag allow_enhanced_conversions --- src/lib/checkout/components/Checkout.jsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lib') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 4c5cca62..6fb5cdb4 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -506,6 +506,8 @@ const Checkout = () => { phone_number: convertToInternational(auth.mobile) ?? convertToInternational(auth.phone), }); + gtag('config', 'AW-954540379', { ' allow_enhanced_conversions':true } ) ; + for (const product of products) deleteItemCart({ productId: product.id }); if (grandTotal > 0) { const payment = await axios.post( -- cgit v1.2.3