Recurring Raffle
Recurring raffle#
Automatically create a new raffle after the draw completes. The completed raffle is preserved with its full winner history, and a fresh duplicate is published with new dates. Useful for weekly, daily, or any regularly repeating raffle.
Enabling#
- Go to WooCommerce → Settings → Raffle → Pro Modules and enable Recurring Raffle.
- Edit a raffle product.
- In the PRO Features section, check Enable recurring.
- Configure the duration, delay, and recurrence limit.
How it works#
- A raffle draw completes (manual or scheduled).
- After the configured delay (default: 60 minutes), WP-Cron fires.
- The module duplicates the completed product using WooCommerce’s built-in product duplicator.
- The duplicate gets fresh start/end dates calculated from the interval settings.
- All ticket sales, winner data, and status are reset on the copy. The original stays as-is.
- The new raffle is published and becomes purchasable immediately (or at its start date).
- If the “Hide completed raffles” option is enabled, the completed raffle is hidden from the shop catalog. It remains published but with catalog visibility set to “hidden”, so it no longer appears in the shop or search results. The product and its winner history are preserved.
Each iteration is a separate WooCommerce product with its own order history, ticket pool, and winner records. This preserves a clean audit trail.
Per-product settings#
| Setting | Description |
|---|---|
| Enable recurring | Master toggle for this raffle. |
| Raffle duration | How long each recurring copy runs (e.g., 7). |
| Duration unit | Hours, days, or weeks. “Use global default” falls back to the global setting. |
| Delay after draw (minutes) | Wait time between draw completion and new raffle creation. Default: 60 minutes. Gives time for prize notification emails to go out before the next raffle appears. |
| Max recurrences | Total number of times to recur. 0 = unlimited. |
Global settings#
Go to WooCommerce → Settings → Raffle → Recurring Raffle for defaults:
| Setting | Description |
|---|---|
| Default Duration | Fallback interval for products set to “Use global default”. |
| Default Duration Unit | Days, hours, or weeks. |
| Default Delay | Minutes to wait before creating the next raffle. |
Date calculation#
The new raffle’s dates are calculated as:
- Start: current time + 5 minutes (after the delay has passed).
- End: start + configured duration.
The original raffle’s start/end dates are not carried forward. Each copy runs for the configured duration regardless of how long the original ran.
Lineage tracking#
The module tracks the chain of recurring raffles:
| Meta key | Purpose |
|---|---|
_rfwc_pro_recurring_source | On a copy: the product ID of the original source raffle. |
_rfwc_pro_recurring_next_id | On the source: the product ID of the next copy in the chain. |
_rfwc_pro_recurring_count | Running total of recurrences from the original source. |
The product edit screen shows this lineage: “This raffle has recurred X time(s)” and “Created from recurring raffle #123” with a link to the source.
Safety mechanisms#
| Scenario | Handling |
|---|---|
| Max recurrences reached | No new raffle is created. A log entry is recorded. |
| Source product deleted | The scheduled cron job checks if the source exists before duplicating. |
| Draw runs but recurring is disabled | The rfwc_raffle_completed hook checks the per-product toggle before scheduling. |
| Cron fires outside admin context | The module explicitly loads WC_Admin_Duplicate_Product since it’s an admin-only class not available during cron. |
| Duplicate product fails | Returns false and logs the failure. The source raffle is not affected. |
Interaction with other systems#
| System | Behaviour |
|---|---|
| Wallet Prize Credit | The copy inherits the wallet credit setting from the source. |
| Reward Points | The copy inherits all reward point settings. |
| Bonus Tickets | Rule configuration is copied. Early bird cutoff dates are duplicated as-is, which may need manual adjustment on the copy. |
| Instant Win | Pre-selected winning ticket numbers are not copied (they would be invalid for the new ticket pool). |
| Ticket Picker / Alphabet | Visual settings are copied. The ticket pool is reset. |