Snippets Checkout

Bootstrap 5 Checkout Form with Order Summary

A checkout layout pairing a product card and spec grid with an order summary, promo code field and payment form.

Bootstrap 5 No jQuery Jun 2020 2.2K views

<section class="wdw-stage">
<div class="container" style="max-width:1080px">
<div class="row g-4 align-items-stretch">
  <div class="col-lg-7">
    <article class="wdw-card h-100 overflow-hidden d-flex flex-column">
      <div class="position-relative">
        <img src="https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1200&q=80" alt="Black grand tourer driving on a highway at dusk" class="w-100 object-fit-cover" style="height:300px">
        <span class="badge text-bg-light rounded-pill position-absolute top-0 start-0 m-3 px-3 py-2">Reservation</span>
      </div>
      <div class="p-4 p-md-4">
        <h2 class="h4 fw-bold mb-1">Grand Tourer GT</h2>
        <p class="wdw-muted mb-4">Hand-finished, delivered to your door and inspected before handover.</p>
        <dl class="row row-cols-2 row-cols-sm-3 g-3 mb-0">
          <div class="col"><dt class="small fw-normal wdw-muted">Mileage</dt><dd class="fw-semibold mb-0">100 km</dd></div>
          <div class="col"><dt class="small fw-normal wdw-muted">Transmission</dt><dd class="fw-semibold mb-0">Automatic</dd></div>
          <div class="col"><dt class="small fw-normal wdw-muted">Drive unit</dt><dd class="fw-semibold mb-0">Front</dd></div>
          <div class="col"><dt class="small fw-normal wdw-muted">Body</dt><dd class="fw-semibold mb-0">Fastback</dd></div>
          <div class="col"><dt class="small fw-normal wdw-muted">Colour</dt><dd class="fw-semibold mb-0">Black</dd></div>
          <div class="col"><dt class="small fw-normal wdw-muted">Stock no.</dt><dd class="fw-semibold mb-0">#002</dd></div>
        </dl>
      </div>
    </article>
  </div>
  <div class="col-lg-5">
    <form class="wdw-card h-100 p-4 d-flex flex-column" id="checkoutForm" novalidate>
      <div class="d-flex justify-content-between align-items-center mb-3">
        <h2 class="h5 fw-bold mb-0">Order ZABHL90</h2>
        <span class="badge bg-success-subtle text-success-emphasis rounded-pill"><i class="bi bi-lock-fill" aria-hidden="true"></i> Secure</span>
      </div>
      <dl class="mb-3">
        <div class="d-flex justify-content-between mb-2"><dt class="fw-normal wdw-muted">Deposit</dt><dd class="mb-0 fw-semibold">$1,240</dd></div>
        <div class="d-flex justify-content-between mb-2"><dt class="fw-normal wdw-muted">Shipping</dt><dd class="mb-0 fw-semibold text-success">Free</dd></div>
        <div class="d-flex justify-content-between mb-2 d-none" id="promoRow"><dt class="fw-normal wdw-muted">Promo code</dt><dd class="mb-0 fw-semibold text-success">−$100</dd></div>
        <div class="d-flex justify-content-between align-items-baseline pt-3 border-top"><dt>Total</dt><dd class="mb-0 fs-3 fw-bold" id="orderTotal" aria-live="polite">$1,240</dd></div>
      </dl>
      <div class="input-group mb-4">
        <input type="text" class="form-control" id="promoInput" placeholder="Promo code (try SAVE100)" aria-label="Promo code">
        <button type="button" class="btn btn-outline-primary" id="promoBtn">Apply</button>
      </div>
      <h3 class="h6 fw-bold mb-3">Payment details</h3>
      <div class="form-floating mb-3"><input type="text" class="form-control" id="cardNum" inputmode="numeric" autocomplete="cc-number" placeholder="Card number" maxlength="19" required><label for="cardNum">Card number</label></div>
      <div class="row g-3 mb-3">
        <div class="col-6"><div class="form-floating"><input type="text" class="form-control" id="cardExp" inputmode="numeric" autocomplete="cc-exp" placeholder="MM/YY" maxlength="5" required><label for="cardExp">Expiry</label></div></div>
        <div class="col-6"><div class="form-floating"><input type="text" class="form-control" id="cardCvc" inputmode="numeric" autocomplete="cc-csc" placeholder="CVC" maxlength="4" required><label for="cardCvc">CVC</label></div></div>
      </div>
      <div class="form-floating mb-4"><input type="text" class="form-control" id="cardName" autocomplete="cc-name" placeholder="Cardholder name" required><label for="cardName">Cardholder name</label></div>
      <button type="submit" class="btn btn-primary btn-lg rounded-pill w-100 mt-auto">Purchase <i class="bi bi-arrow-right" aria-hidden="true"></i></button>
      <p class="small text-success text-center mt-3 mb-0 d-none" id="checkoutDone" role="status">Thank you! Your reservation is confirmed.</p>
    </form>
  </div>
</div>
</div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.