Checkout Page

import React, { useState } from ‘react’;
import { CreditCard, Check, ShieldCheck, ChevronDown, Tag, UserCircle } from ‘lucide-react’;

const InputField = ({ label, required, type = “text”, placeholder = “”, className = “” }) => (


);

const SelectField = ({ label, required, options, className = “” }) => (


);

export default function App() {
const [shipToDifferent, setShipToDifferent] = useState(false);
const [paymentMethod, setPaymentMethod] = useState(‘bacs’);
const [showCoupon, setShowCoupon] = useState(false);

const cartItems = [
{ id: 1, name: “Premium Wireless Headphones”, quantity: 1, price: 299.00 },
{ id: 2, name: “Ergonomic Desk Chair”, quantity: 1, price: 199.50 },
{ id: 3, name: “USB-C Charging Cable (2m)”, quantity: 2, price: 15.00 }
];

const subtotal = cartItems.reduce((acc, item) => acc + (item.price * item.quantity), 0);
const shipping = 15.00;
const tax = subtotal * 0.08; // 8% mock tax
const total = subtotal + shipping + tax;

return (

{/* Header / Page Title */}

Checkout

Securely complete your purchase.

{/* WooCommerce style notices */}


Returning customer? Click here to login

Have a coupon?

{showCoupon && (


)}

{/* Left Column: Billing Details */}

Billing details



{/* Account Creation Toggle */}

{/* Ship to Different Address Toggle */}

{/* Animated Shipping Form Expansion */}






{/* Order Notes */}


{/* Right Column: Order Summary & Payment */}

Your order

{/* Order Table */}

{cartItems.map((item) => (

))}

ProductSubtotal
{item.name}
× {item.quantity}
${(item.price * item.quantity).toFixed(2)}
Subtotal${subtotal.toFixed(2)}
Shipping Flat rate: ${shipping.toFixed(2)}
Tax${tax.toFixed(2)}
Total${total.toFixed(2)}

{/* Payment Gateway Area */}

{/* BACS Payment */}


{paymentMethod === ‘bacs’ && (

Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order will not be shipped until the funds have cleared in our account.

)}

{/* Check Payments */}


{paymentMethod === ‘cheque’ && (

Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.

)}

{/* Cash on Delivery */}


{paymentMethod === ‘cod’ && (

Pay with cash upon delivery.

)}

{/* Credit Card / Stripe Mock */}

Your personal data will be used to process your order, support your experience throughout this website, and for other purposes described in our privacy policy.


Guaranteed safe & secure checkout

);
}

Cart (0 items)
Cart (0 items)
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare