From c653472382834bb5f900523e15befa7ce98faf11 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 18 Sep 2023 15:02:22 +0700 Subject: homepage service list --- src/lib/home/components/ServiceList.jsx | 105 ++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/lib/home/components/ServiceList.jsx (limited to 'src/lib') diff --git a/src/lib/home/components/ServiceList.jsx b/src/lib/home/components/ServiceList.jsx new file mode 100644 index 00000000..56e7fc0d --- /dev/null +++ b/src/lib/home/components/ServiceList.jsx @@ -0,0 +1,105 @@ +import Image from 'next/image' +import Link from '@/core/components/elements/Link/Link' + +const ServiceList = () => { + return ( +
+
+
+ +
+ +
+
+

One Stop Solution

+

+ Temukan Solusi Lengkap Anda dalam Satu Tempat. +

+
+ +
+
+ +
+ +
+
+

Garansi Resmi

+

+ Garansi dan Kualitas produk yang terjamin ke aslianya. +

+
+ +
+
+ +
+ +
+
+

Pembayaran Tempo

+

+ Lebih mudah mengatur pembelian dengan pembayaran tempo. +

+
+ +
+
+ +
+ +
+
+

Faktur Pajak

+

+ Dapat Faktur pajak untuk setiap transaksi dengan indoteknik.com +

+
+ +
+
+
+ ) +} + +export default ServiceList -- cgit v1.2.3 From 46da815603ee8e53eeaa7480f62eaf6369681373 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 19 Sep 2023 09:21:13 +0700 Subject: add rounded --- src/lib/home/components/ServiceList.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/home/components/ServiceList.jsx b/src/lib/home/components/ServiceList.jsx index 56e7fc0d..8613a37c 100644 --- a/src/lib/home/components/ServiceList.jsx +++ b/src/lib/home/components/ServiceList.jsx @@ -8,7 +8,7 @@ const ServiceList = () => {
{
{
{
Date: Fri, 22 Sep 2023 10:35:48 +0700 Subject: fixing error cart --- src/lib/cart/components/Cartheader.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index dd6c276e..ab5dfdaa 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -158,14 +158,14 @@ const Cardheader = (cartCount) => {
))} - {products.length === 0 && !isLoading && ( + {auth && products.length === 0 && !isLoading && (

Tidak Ada Produk di Keranjang Belanja Anda

)} - {products.length > 0 && !isLoading && ( + {auth && products.length > 0 && !isLoading && ( <>
    {products && @@ -251,10 +251,10 @@ const Cardheader = (cartCount) => { )}
- {products.length > 0 && !isLoading && ( + {auth && products.length > 0 && !isLoading && ( <>
- Sub Total Sebelum PPN : + Subtotal Sebelum PPN : Rp. {currencyFormat(subTotal)}
-- cgit v1.2.3 From 8e4e981060b612f5d21f141d62656df80e2a0a4b Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 22 Sep 2023 11:31:14 +0700 Subject: bugs fix rp double --- src/lib/cart/components/Cartheader.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index ab5dfdaa..863b8a46 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -255,7 +255,7 @@ const Cardheader = (cartCount) => { <>
Subtotal Sebelum PPN : - Rp. {currencyFormat(subTotal)} + {currencyFormat(subTotal)}

+ {/* */}
{!auth && (
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 40f7958bc995fbe098598448097308180a359b8b Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 22 Sep 2023 16:47:25 +0700 Subject: update label service list garansi resmi --- src/lib/home/components/ServiceList.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/home/components/ServiceList.jsx b/src/lib/home/components/ServiceList.jsx index 8613a37c..b8799d7d 100644 --- a/src/lib/home/components/ServiceList.jsx +++ b/src/lib/home/components/ServiceList.jsx @@ -46,7 +46,7 @@ const ServiceList = () => {

Garansi Resmi

- Garansi dan Kualitas produk yang terjamin ke aslianya. + Garansi Keaslian Barang dan Jaminan Purna Jual.

-- 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/cart/components/Cartheader.jsx | 3 +-- src/lib/product/components/Product/ProductDesktopVariant.jsx | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index 085b9408..d330ccb6 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -49,7 +49,7 @@ const Cardheader = (cartCount) => { setProductCart(cart) setCountCart(cart.productTotal) setIsloading(false) - }, [setProductCart]) + }, [setProductCart, setIsloading]) useEffect(() => { if (!products) return @@ -74,7 +74,6 @@ const Cardheader = (cartCount) => { useEffect(() => { if (refreshCart) { refreshCartf() - console.log('ini masuk') } setRefreshCart(false) }, [refreshCart, refreshCartf, setRefreshCart]) 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 4d329fbe4ecadd7864809f340d9e4f46d910e418 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 25 Sep 2023 09:28:23 +0700 Subject: delete coponent summary product --- src/lib/cart/components/Cartheader.jsx | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index d330ccb6..cbe7c7e1 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -8,7 +8,6 @@ import { useRouter } from 'next/router' import odooApi from '@/core/api/odooApi' import { useProductCartContext } from '@/contexts/ProductCartContext' import whatsappUrl from '@/core/utils/whatsappUrl' -import SummaryProduct from '@/core/components/elements/Product/SummaryProduct' const { ShoppingCartIcon, PhotoIcon } = require('@heroicons/react/24/outline') const { default: Link } = require('next/link') @@ -132,7 +131,6 @@ const Cardheader = (cartCount) => {

- {/* */}
{!auth && (
-- cgit v1.2.3 From 065a0e341cc42443fe5e2380e078983b3c66f111 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 25 Sep 2023 16:48:25 +0700 Subject: migrasi get brand di homepage dan page all brand ke solr --- src/lib/brand/components/Brands.jsx | 18 ++++++++++++++---- src/lib/home/components/PreferredBrand.jsx | 7 +++++-- src/lib/home/hooks/usePreferredBrand.js | 13 ++++++++++++- 3 files changed, 31 insertions(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/brand/components/Brands.jsx b/src/lib/brand/components/Brands.jsx index c7483e40..ccdd134d 100644 --- a/src/lib/brand/components/Brands.jsx +++ b/src/lib/brand/components/Brands.jsx @@ -2,6 +2,7 @@ import odooApi from '@/core/api/odooApi' import { useCallback, useEffect, useState } from 'react' import BrandCard from './BrandCard' import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner' +import axios from 'axios' const Brands = () => { const alpha = Array.from(Array(26)).map((e, i) => i + 65) @@ -13,13 +14,22 @@ const Brands = () => { const loadBrand = useCallback(async () => { setIsLoading(true) - const name = startWith ? `${startWith}%` : '' - const result = await odooApi( + const name = startWith ? `${startWith}*` : '' + //Get brand from odoo + /*const result = await odooApi( 'GET', `/api/v1/manufacture?limit=0&offset=${manufactures.length}&name=${name}` - ) + )*/ + + // Change get brands from solr + let result = null + if (name) { + result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=${name}`) + } else { + result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands`) + } setIsLoading(false) - setManufactures((manufactures) => [...manufactures, ...result.manufactures]) + setManufactures((manufactures) => [...manufactures, ...result.data]) }, [startWith]) const toggleStartWith = (alphabet) => { diff --git a/src/lib/home/components/PreferredBrand.jsx b/src/lib/home/components/PreferredBrand.jsx index 55abe0b7..0b80bcf1 100644 --- a/src/lib/home/components/PreferredBrand.jsx +++ b/src/lib/home/components/PreferredBrand.jsx @@ -6,7 +6,10 @@ import useDevice from '@/core/hooks/useDevice' import Link from '@/core/components/elements/Link/Link' const PreferredBrand = () => { - const { preferredBrands } = usePreferredBrand() + let query = 'level_s' + let params = 'prioritas' + const { preferredBrands } = usePreferredBrand(query, params) + console.log('ini brands level', preferredBrands?.data?.data) const { isMobile, isDesktop } = useDevice() return ( @@ -22,7 +25,7 @@ const PreferredBrand = () => { {preferredBrands.isLoading && } {!preferredBrands.isLoading && ( - {preferredBrands.data?.manufactures.map((brand) => ( + {preferredBrands.data?.data.map((brand) => ( diff --git a/src/lib/home/hooks/usePreferredBrand.js b/src/lib/home/hooks/usePreferredBrand.js index e56d361f..d2f2bcf1 100644 --- a/src/lib/home/hooks/usePreferredBrand.js +++ b/src/lib/home/hooks/usePreferredBrand.js @@ -1,3 +1,4 @@ +import axios from 'axios' import preferredBrandApi from '../api/preferredBrandApi' import { useQuery } from 'react-query' @@ -10,4 +11,14 @@ const usePreferredBrand = () => { } } -export default usePreferredBrand +const GetBrands = (query, params) => { + const fetchingbrand = async () => + await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=` + query) + + const { data, isLoading } = useQuery('preferredBrand', fetchingbrand) + return { + preferredBrands: { data, isLoading } + } +} + +export default GetBrands -- cgit v1.2.3 From 5b281f755af9277b75a199195d693cf49dc49d29 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 25 Sep 2023 17:09:09 +0700 Subject: asc by image --- src/lib/brand/components/Brands.jsx | 1 - 1 file changed, 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/brand/components/Brands.jsx b/src/lib/brand/components/Brands.jsx index ccdd134d..c94e47c2 100644 --- a/src/lib/brand/components/Brands.jsx +++ b/src/lib/brand/components/Brands.jsx @@ -1,4 +1,3 @@ -import odooApi from '@/core/api/odooApi' import { useCallback, useEffect, useState } from 'react' import BrandCard from './BrandCard' import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner' -- 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') 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:11:13 +0700 Subject: brand solr dan sort by image --- src/lib/brand/components/Brands.jsx | 10 +++------- src/lib/home/components/PreferredBrand.jsx | 3 +-- src/lib/home/hooks/usePreferredBrand.js | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/lib') diff --git a/src/lib/brand/components/Brands.jsx b/src/lib/brand/components/Brands.jsx index c94e47c2..f6cb4fbf 100644 --- a/src/lib/brand/components/Brands.jsx +++ b/src/lib/brand/components/Brands.jsx @@ -21,14 +21,10 @@ const Brands = () => { )*/ // Change get brands from solr - let result = null - if (name) { - result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=${name}`) - } else { - result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands`) - } + const result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=${name}`) + setIsLoading(false) - setManufactures((manufactures) => [...manufactures, ...result.data]) + setManufactures((manufactures) => [...result.data]) }, [startWith]) const toggleStartWith = (alphabet) => { diff --git a/src/lib/home/components/PreferredBrand.jsx b/src/lib/home/components/PreferredBrand.jsx index 0b80bcf1..571c4745 100644 --- a/src/lib/home/components/PreferredBrand.jsx +++ b/src/lib/home/components/PreferredBrand.jsx @@ -8,8 +8,7 @@ import Link from '@/core/components/elements/Link/Link' const PreferredBrand = () => { let query = 'level_s' let params = 'prioritas' - const { preferredBrands } = usePreferredBrand(query, params) - console.log('ini brands level', preferredBrands?.data?.data) + const { preferredBrands } = usePreferredBrand(query) const { isMobile, isDesktop } = useDevice() return ( diff --git a/src/lib/home/hooks/usePreferredBrand.js b/src/lib/home/hooks/usePreferredBrand.js index d2f2bcf1..b7d707e6 100644 --- a/src/lib/home/hooks/usePreferredBrand.js +++ b/src/lib/home/hooks/usePreferredBrand.js @@ -11,7 +11,7 @@ const usePreferredBrand = () => { } } -const GetBrands = (query, params) => { +const GetBrands = (query) => { const fetchingbrand = async () => await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=` + query) -- cgit v1.2.3 From 8402f53f80fe34dc926b9eebaab143884294cdb0 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly 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') 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/checkout/components/CheckoutOld.jsx | 1 - 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 +- 8 files changed, 199 insertions(+), 262 deletions(-) (limited to 'src/lib') diff --git a/src/lib/checkout/components/CheckoutOld.jsx b/src/lib/checkout/components/CheckoutOld.jsx index 088b641b..6852059e 100644 --- a/src/lib/checkout/components/CheckoutOld.jsx +++ b/src/lib/checkout/components/CheckoutOld.jsx @@ -22,7 +22,6 @@ import DesktopView from '@/core/components/views/DesktopView' import ExpedisiList from '../api/ExpedisiList' import whatsappUrl from '@/core/utils/whatsappUrl' import { createSlug } from '@/core/utils/slug' -import { Button, Modal } from 'flowbite-react' import BottomPopup from '@/core/components/elements/Popup/BottomPopup' const SELF_PICKUP_ID = 32 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 607b943dae3cacffcd76a6763fddc3c218792d74 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 29 Sep 2023 15:35:44 +0700 Subject: Add except for non publish product solr --- src/lib/home/components/Skeleton/PopularProductSkeleton.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx b/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx index 29fda966..754bdd57 100644 --- a/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx +++ b/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx @@ -11,7 +11,8 @@ const PopularProductSkeleton = () => (
-
+
+ -- 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') 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.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') 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