Guest Checkout Flow ​

Guest Checkout Flow

Overview

This update improves the guest checkout experience for customers who check out without creating an account, and fixes a few related issues that surfaced during testing.

What Changed

  1. Guest Checkout is now available. Customers who visit our shop were previously gate-kept. They were unable to purchase anything from our website without an account. 
  2. Easy account creation after checkout. On the order confirmation page, guests now see a "Create account" button. Clicking it takes them to the signup page with their name and email already filled in, so they don't have to retype anything.
  3. "Track your order" now works for guests. Previously, clicking "Track your order" on the confirmation page sent guests to a login screen since they had no account. It now uses a secure order-specific link that works without logging in.
  4. Friendlier message when an email is already registered. If a guest types in an email that matches an existing account, they used to see a popup pushing them to log in. Now the popup says "We found an existing account" and gives them the choice to use a different email or simply continue checking out as a guest, no login required.
  5. If someone continues to checkout as a guest, and they already have a previous order, the new order appends to the previous account in the backend. 
File What it does
bista_menmd_website/controllers/website_sale.py When a guest checks out, the system now searches for an existing patient with the same email before creating a new one. If found, the order is linked to that existing record instead.
bista_menmd_website/models/sale_order.py Added a helper method that builds a signup link pre-filled with the guest's name and email, for use on the confirmation page.
bista_menmd_customization/views/website_sale_confirmation.xml Added the "Save your info for next time" card with the "Create account" button; changed the "Track your order" link to use a secure guest-accessible link; removed the old "Sign Up to follow your order" banner.
bista_menmd_website/views/shop_auth_gate_template.xml Created a popup that appears when a guest's email matches an existing account: the button now lets them continue as a guest instead of forcing a login.
bista_menmd_website/static/src/js/guest_email_check.js "Continue as guest" actually resumes checkout instead of redirecting to the login page.
bista_menmd_website/static/src/scss/main.scss Minor styling cleanup related to the removed banner.

How to Test

Test 1: New guest, no existing account

  1. Add a product to the cart and go to checkout as a guest, using an email that has never ordered before.
  2. Complete checkout.
  3. Expect: No popup during checkout. On the confirmation page, you should see a "Save your info for next time" card with a "Create account" button, and no "Sign Up to follow your order" banner.
  4. Click "Create account." Expect: the signup page opens with your name and email already filled in.

Test 2: Guest checkout with an email that already has an account

  1. Start a guest checkout using an email that matches an existing patient record.
  2. Expect: A popup titled "We found an existing account," with the options "Use a different email" and "Continue as guest."
  3. Click "Continue as guest." Expect: checkout proceeds normally, no redirect to a login page.
  4. Complete the order, then check the customer record in the backend (Contacts). Expect: no duplicate patient record was created; the order is attached to the existing patient.

Test 3: Track your order

  1. From either test above, on the confirmation page, click "Track your order."
  2. Expect: you're taken directly to the order tracking/detail page, not redirected to a login screen.

Test 4: Logged-in customer (regression check)

  1. Log in to an existing account and complete a checkout.
  2. Expect: the confirmation page looks normal, and the "Save your info for next time" card does not appear (since you already have an account).

Notes for UAT

  • Testing full payment locally requires either Odoo's built-in Demo payment provider (test mode) or an HTTPS tunnel (e.g. ngrok), since the live payment gateway rejects plain HTTP connections. This shouldn't affect UAT/production, which should already run over HTTPS.
  • Not yet addressed (flagged for future follow-up): confirming that saved payment methods or other account-level details are never shown to a guest whose email happened to match an existing account. Order-level data (this order's items, address, total) is safe; this is about making sure nothing account-wide leaks through.