"use client"; import { useContextElement } from "@/context/Context"; import Image from "next/image"; import Link from "next/link"; export default function Checkout() { const { cartProducts, setCartProducts, totalPrice } = useContextElement(); return (
Already have an account? Sign in for faster checkout experience.

Billing address

e.preventDefault()} >
Valid first name is required.
Valid last name is required.
Please enter a valid email address for shipping updates.
Please enter your shipping address.
Please select a valid country.
Please provide a valid state.
Zip code required.


Payment

Credit card number is required
Name on card is required
Expiration date required
Security code required
{/* /column */}

Order Summary

{cartProducts.length ? (
{cartProducts.map((product, i) => (
{product.title}

{product.title}

Color: Black
Size: 43

{" "} ${(product.price * product.quantity).toFixed(2)}

))}
) : ( <>
Cart is empty
Explore Products )} {/* /.shopping-cart*/}

Shipping

Shipment may take 5-6 business days
Shipment may take 2-3 business days
Subtotal

${totalPrice.toFixed(2)}

Discount (5%)

-${totalPrice ? (totalPrice / 100) * 5 : 0}

Shipping

${totalPrice ? 10 : 0}

Grand Total

$ {totalPrice ? (totalPrice - (totalPrice / 100) * 5 + 10).toFixed( 2 ) : 0}

Place Order
{/* /column */}
{/* /.row */}
{/* /.container */}
); }