From e186f6123a13bd2976dc3cf2b2eb8f98f9430f51 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 28 Dec 2022 12:01:39 +0700 Subject: no message --- src/components/ProgressBar.js | 9 +- src/pages/shop/cart.js | 277 +++++++++++++++++++++--------------------- 2 files changed, 143 insertions(+), 143 deletions(-) (limited to 'src') diff --git a/src/components/ProgressBar.js b/src/components/ProgressBar.js index cdb55205..8a2df0a4 100644 --- a/src/components/ProgressBar.js +++ b/src/components/ProgressBar.js @@ -1,12 +1,11 @@ -import { CheckIcon } from "@heroicons/react/24/outline"; -import { CheckCircleIcon } from "@heroicons/react/24/solid"; +import { Fragment } from "react"; const ProgressBar = ({ current, labels }) => { return (
{labels.map((label, index) => ( - <> -
+ +
{ index + 1 }
@@ -17,7 +16,7 @@ const ProgressBar = ({ current, labels }) => {
) } - +
))}
) diff --git a/src/pages/shop/cart.js b/src/pages/shop/cart.js index 5a228077..f4a07295 100644 --- a/src/pages/shop/cart.js +++ b/src/pages/shop/cart.js @@ -161,167 +161,168 @@ export default function Cart() { - - -
- - {/* --- Start Alert */} - {!isLoadingProducts && ( - -
- -
- - {products.length > 0 ? ( - <>Mohon dicek kembali & pastikan pesanan kamu sudah sesuai dengan yang kamu butuhkan. Atau bisa hubungi kami. - ) : ( - <>Anda belum menambahkan barang apapun ke keranjang. - )} - -
- )} - {/* ---- End Alert */} - {isLoadingProducts && (
Loading...
)} -
+ { !isLoadingProducts && products.length == 0 && ( +
+ +

Keranjang belanja anda masih kosong.

+ Mulai Belanja +
+ ) } + + { !isLoadingProducts && products.length > 0 && ( + <> + -
- {/* [Start] Product List */} -
- {products.map((product, index) => ( -
-
- - {product.parent.name} +
+ + {/* --- Start Alert */} + +
+
-
- - {product.parent.name} - -

- {product.code || '-'} - {product.attributes.length > 0 ? ` | ${product.attributes.join(', ')}` : ''} -

-
-

{currencyFormat(product.price.price_discount)}

- {product.price.discount_percentage > 0 ? ( - <> - {product.price.discount_percentage}% -

{currencyFormat(product.price.price)}

- - ) : ''} - -
-
-

{currencyFormat(product.quantity * product.price.price_discount)}

-
- + Mohon dicek kembali & pastikan pesanan kamu sudah sesuai dengan yang kamu butuhkan. Atau bisa hubungi kami. + + {/* ---- End Alert */} + +
+ +
+ {/* [Start] Product List */} +
+ {products.map((product, index) => ( +
+
- blurQuantity(product.id, e.target.value)} - onChange={(e) => updateQuantity(product.id, e.target.value)} - value={product.quantity} + className={'p-2 rounded border-2 ' + (product.to_process ? 'border-yellow_r-9 bg-yellow_r-9' : 'border-gray_r-12')} + onClick={() => toggleProductToProcess(product.id)} + > + {product.parent.name} - +
+
+ + {product.parent.name} + +

+ {product.code || '-'} + {product.attributes.length > 0 ? ` | ${product.attributes.join(', ')}` : ''} +

+
+

{currencyFormat(product.price.price_discount)}

+ {product.price.discount_percentage > 0 ? ( + <> + {product.price.discount_percentage}% +

{currencyFormat(product.price.price)}

+ + ) : ''} + +
+
+

{currencyFormat(product.quantity * product.price.price_discount)}

+
+ + + blurQuantity(product.id, e.target.value)} + onChange={(e) => updateQuantity(product.id, e.target.value)} + value={product.quantity} + /> + +
+
+ ))}
+ {/* [End] Product List */}
- ))} -
- {/* [End] Product List */} -
-
+
-
- {/* [Start] Review Order */} - {products.length > 0 ? ( -
-
-

Ringkasan Pesanan

- {getProductsToProcess().length > 0 ? ( -

{getProductsToProcess().length} Barang

- ) : ''} -
-
-
-
-

Subtotal

-

{currencyFormat(totalPriceBeforeTax)}

+
+ {/* [Start] Review Order */} +
+
+

Ringkasan Pesanan

+ {getProductsToProcess().length > 0 && ( +

{getProductsToProcess().length} Barang

+ )}
-
-

PPN 11%

-

{currencyFormat(totalTaxAmount)}

+
+
+
+

Subtotal

+

{currencyFormat(totalPriceBeforeTax)}

+
+
+

PPN 11%

+

{currencyFormat(totalTaxAmount)}

+
+
+

Total Diskon

+

- {currencyFormat(totalDiscountAmount)}

+
-
-

Total Diskon

-

- {currencyFormat(totalDiscountAmount)}

+
+
+

Grand Total

+

{currencyFormat(totalPriceBeforeTax + totalTaxAmount - totalDiscountAmount)}

+

*) Belum termasuk biaya pengiriman

+

+ Dengan melakukan pembelian melalui website Indoteknik, saya menyetujui Syarat & Ketentuan yang berlaku +

-
-
-

Grand Total

-

{currencyFormat(totalPriceBeforeTax + totalTaxAmount - totalDiscountAmount)}

+ {/* [End] Review Order */} + + {/* [Start] Submit Button */} +
+ +
-

*) Belum termasuk biaya pengiriman

-

- Dengan melakukan pembelian melalui website Indoteknik, saya menyetujui Syarat & Ketentuan yang berlaku -

-
- ) : ''} - {/* [End] Review Order */} + {/* [End] Submit Button */} - {/* [Start] Submit Button */} - {products.length > 0 ? ( -
- -
- ) : ''} - {/* [End] Submit Button */} -
+ + ) } ); -- cgit v1.2.3