From e8745f729cb48a2cab96f8f216617240326f2018 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 13 Aug 2024 14:39:08 +0700 Subject: add feature pickup service --- src-migrate/modules/cart/components/Item.tsx | 5 +++-- src/lib/checkout/components/Checkout.jsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index 47893498..44ec4fd5 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -17,11 +17,11 @@ import CartItemSelect from './ItemSelect' type Props = { item: CartItemProps editable?: boolean + selfPicking?: boolean pilihSemuaCart?: boolean } -const CartItem = ({ item, editable = true,}: Props) => { - +const CartItem = ({ item, editable = true, selfPicking}: Props) => { return (
{item.cart_type === 'promotion' && ( @@ -53,6 +53,7 @@ const CartItem = ({ item, editable = true,}: Props) => {
+ {/* disini */}
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 09a791ee..5f771f41 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -1295,7 +1295,7 @@ const Checkout = () => {
{!!products && snakecaseKeys(products).map((item, index) => ( - + ))}
-- cgit v1.2.3 From a72f9273664715e9708523ca1a6a4554bd22c917 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 13 Aug 2024 15:37:29 +0700 Subject: update pickup service add field --- src-migrate/modules/cart/components/Item.tsx | 1 + src-migrate/types/cart.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index 44ec4fd5..25df62fe 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -54,6 +54,7 @@ const CartItem = ({ item, editable = true, selfPicking}: Props) => {
{/* disini */} + {/* {selfPicking && (item.is_in_bu) && (item.on_hand_qty > item.quantity)} */}
diff --git a/src-migrate/types/cart.ts b/src-migrate/types/cart.ts index 4e3c8b99..a3115103 100644 --- a/src-migrate/types/cart.ts +++ b/src-migrate/types/cart.ts @@ -32,6 +32,8 @@ export type CartItem = { id: number; name: string; stock: number; + is_in_bu: boolean; + on_hand_qty: number; weight: number; attributes: string[]; parent: { -- cgit v1.2.3 From 62704c101d17afb7f71389ef23d6183b2cd16dfa Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 14 Aug 2024 15:11:33 +0700 Subject: update self picking di product card --- src-migrate/modules/cart/components/Item.tsx | 6 +++++- src-migrate/types/product.ts | 1 + src/lib/product/components/ProductCard.jsx | 28 ++++++++++++++++++++++++---- src/utils/solrMapping.js | 1 + 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index 25df62fe..ce4c5bff 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -54,7 +54,11 @@ const CartItem = ({ item, editable = true, selfPicking}: Props) => {
{/* disini */} - {/* {selfPicking && (item.is_in_bu) && (item.on_hand_qty > item.quantity)} */} + {selfPicking && (item.is_in_bu) && (item.on_hand_qty > item.quantity) && ( +
+ Barang ini bisa di pickup maksimal pukul 16.00 +
+ )}
diff --git a/src-migrate/types/product.ts b/src-migrate/types/product.ts index 681cdc8e..31ea0ce1 100644 --- a/src-migrate/types/product.ts +++ b/src-migrate/types/product.ts @@ -12,6 +12,7 @@ export interface IProduct { variant_total: number; description: string; isSni: boolean; + is_in_bu: boolean; isTkdn: boolean; categories: { id: string; diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 35e2a665..4b3f693c 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -147,9 +147,20 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.manufacture?.name ? ( - - {product.manufacture.name} - +
+ +
+ {product.manufacture.name} +
+ + {product?.is_in_bu && ( +
+ + Click & Pickup + +
+ )} +
) : (
-
)} @@ -292,9 +303,18 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)} {product?.manufacture?.name ? ( - +
+ {product.manufacture.name} + {/* {product?.is_in_bu && ( +
+ + Click & Pickup + +
+ )} */} +
) : (
-
)} diff --git a/src/utils/solrMapping.js b/src/utils/solrMapping.js index d4694eb2..fee474be 100644 --- a/src/utils/solrMapping.js +++ b/src/utils/solrMapping.js @@ -38,6 +38,7 @@ export const productMappingSolr = (products, pricelist) => { qtySold: product?.qty_sold_f || 0, isTkdn:product?.tkdn_b || false, isSni:product?.sni_b || false, + is_in_bu:product?.is_in_bu_b || false, voucherPastiHemat:product?.voucher_pastihemat || [] }; -- cgit v1.2.3 From 08e5b76ba58645929ddeda1830f85f3eaf43969e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 14 Aug 2024 17:01:44 +0700 Subject: update pickup service logic --- src-migrate/modules/cart/components/Item.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index ce4c5bff..272fa622 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -54,7 +54,7 @@ const CartItem = ({ item, editable = true, selfPicking}: Props) => {
{/* disini */} - {selfPicking && (item.is_in_bu) && (item.on_hand_qty > item.quantity) && ( + {selfPicking && (item.is_in_bu) && (item.on_hand_qty >= item.quantity) && (
Barang ini bisa di pickup maksimal pukul 16.00
-- cgit v1.2.3