Docs Raffle for WooCommerce

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#

  1. Go to WooCommerce → Settings → Raffle → Pro Modules and enable Recurring Raffle.
  2. Edit a raffle product.
  3. In the PRO Features section, check Enable recurring.
  4. Configure the duration, delay, and recurrence limit.

How it works#

  1. A raffle draw completes (manual or scheduled).
  2. After the configured delay (default: 60 minutes), WP-Cron fires.
  3. The module duplicates the completed product using WooCommerce’s built-in product duplicator.
  4. The duplicate gets fresh start/end dates calculated from the interval settings.
  5. All ticket sales, winner data, and status are reset on the copy. The original stays as-is.
  6. The new raffle is published and becomes purchasable immediately (or at its start date).
  7. 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#

SettingDescription
Enable recurringMaster toggle for this raffle.
Raffle durationHow long each recurring copy runs (e.g., 7).
Duration unitHours, 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 recurrencesTotal number of times to recur. 0 = unlimited.

Global settings#

Go to WooCommerce → Settings → Raffle → Recurring Raffle for defaults:

SettingDescription
Default DurationFallback interval for products set to “Use global default”.
Default Duration UnitDays, hours, or weeks.
Default DelayMinutes 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 keyPurpose
_rfwc_pro_recurring_sourceOn a copy: the product ID of the original source raffle.
_rfwc_pro_recurring_next_idOn the source: the product ID of the next copy in the chain.
_rfwc_pro_recurring_countRunning 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#

ScenarioHandling
Max recurrences reachedNo new raffle is created. A log entry is recorded.
Source product deletedThe scheduled cron job checks if the source exists before duplicating.
Draw runs but recurring is disabledThe rfwc_raffle_completed hook checks the per-product toggle before scheduling.
Cron fires outside admin contextThe module explicitly loads WC_Admin_Duplicate_Product since it’s an admin-only class not available during cron.
Duplicate product failsReturns false and logs the failure. The source raffle is not affected.

Interaction with other systems#

SystemBehaviour
Wallet Prize CreditThe copy inherits the wallet credit setting from the source.
Reward PointsThe copy inherits all reward point settings.
Bonus TicketsRule configuration is copied. Early bird cutoff dates are duplicated as-is, which may need manual adjustment on the copy.
Instant WinPre-selected winning ticket numbers are not copied (they would be invalid for the new ticket pool).
Ticket Picker / AlphabetVisual settings are copied. The ticket pool is reset.