Get Plugin
DocsRaffle for WooCommercePro/Ticket Reservation

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

SettingLocationDescription
Ticket Reservation (module)WooCommerce → Settings → Raffle → Pro ModulesEnable/disable the reservation system globally
Default reservation timeoutWooCommerce → Settings → Raffle → Ticket PickerGlobal default duration in minutes (default: 5)
Enable ticket reservationPer-product → PRO FeaturesEnable/disable for this specific raffle
Reservation timeout (minutes)Per-product → PRO FeaturesOverride the global default for this raffle
Scroll to see all columns →

Visual states

StateAppearanceBehaviour
AvailableDefault colorClickable — reserves on click
Reserved (yours)Selected/highlightedClickable — releases on click
Reserved (other)Amber backgroundNot clickable
LoadingSpinner overlayWaiting for AJAX response
SoldGreyNot 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 to
  • ticket_number — the reserved ticket number
  • session_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.