Pro/Ticket Reservation
Ticket Reservation
Hold selected tickets for a limited time so customers don't lose their choices to another buyer during checkout. When a customer clicks a ticket in the Ticket Picker, it's immediately reserved server-side and becomes unavailable to other visitors until the reservation expires.
Enabling
- Go to WooCommerce → Settings → Raffle → Pro Modules and enable Ticket Reservation.
- Edit a raffle product with the Ticket Picker enabled.
- In the PRO Features section, check Enable ticket reservation.
How it works
- Customer clicks an available ticket in the picker → an AJAX call reserves it on the server.
- The ticket turns to a "selected" state for this customer and an "reserved" (amber) state for everyone else.
- A countdown timer appears showing how long the reservation lasts.
- When the timer expires, the ticket is automatically released back to the pool.
- Clicking a reserved ticket again releases it immediately.
- On checkout, the system validates that the selected tickets are still reserved by this customer.
Settings
| Setting | Location | Description |
|---|---|---|
| Ticket Reservation (module) | WooCommerce → Settings → Raffle → Pro Modules | Enable/disable the reservation system globally |
| Default reservation timeout | WooCommerce → Settings → Raffle → Ticket Picker | Global default duration in minutes (default: 5) |
| Enable ticket reservation | Per-product → PRO Features | Enable/disable for this specific raffle |
| Reservation timeout (minutes) | Per-product → PRO Features | Override the global default for this raffle |
Scroll to see all columns →
Visual states
| State | Appearance | Behaviour |
|---|---|---|
| Available | Default color | Clickable — reserves on click |
| Reserved (yours) | Selected/highlighted | Clickable — releases on click |
| Reserved (other) | Amber background | Not clickable |
| Loading | Spinner overlay | Waiting for AJAX response |
| Sold | Grey | Not clickable |
Scroll to see all columns →
Countdown timer
- Appears when the customer has at least one active reservation.
- Shows the time remaining for the earliest expiring reservation.
- Turns red with a pulse animation when under 60 seconds remain.
- When all reservations expire, the grid refreshes and the timer disappears.
Data storage
Reservations are stored in a custom database table ({prefix}_rfwc_pro_reservations) with:
raffle_id— which raffle the ticket belongs toticket_number— the reserved ticket numbersession_id— identifies the customer (logged-in user ID or WC session ID)expires_at— when the reservation expires- A unique constraint on
(raffle_id, ticket_number)prevents double-booking.
Cleanup
A WP-Cron job runs every 5 minutes to delete expired reservations. The cron is scheduled on plugin activation and cleared on deactivation.
Cart integration
- Removing a raffle product from the cart releases its reservations.
- At add-to-cart time, the system validates that the selected tickets are still reserved by this session.
- After order completion (tickets generated), reservations are cleaned up.