Volunteer Sales
Volunteer Sales#
Track which volunteer sold each ticket using shareable referral links and QR codes. Built for charity raffles, club fundraisers, and any setup where you want to credit a specific person for the tickets that come in through their efforts.
Optionally, restrict each volunteer to a specific range of ticket numbers so two people can never sell the same number.
Enabling#
- Go to WooCommerce → Settings → Raffle → Pro Modules and enable Volunteer Sales.
- Edit a raffle product.
- In the PRO Features section, check Volunteer Sales.
- Click Manage volunteers for this raffle to add your first volunteer.
The full management screen lives at WooCommerce → Raffle Tickets → Volunteers.
Adding a volunteer#
Each volunteer record holds:
| Field | Description |
|---|---|
| Name | Required. Shown on the leaderboard and inside notification emails. |
| Optional. Required only if the volunteer wants sale notifications. | |
| Referral code | A short alphanumeric code (auto-generated; you can override). Appended to the raffle URL as ?vref=CODE. Must be unique within the raffle. |
| Ticket number range | Optional. When set, the volunteer can only sell numbers inside this range. Leave blank for unrestricted access. |
| Sale notifications | Off by default. When on, the volunteer’s email gets a short message each time one of their links sells a ticket. |
| Status | Active or Disabled. Disabled volunteers stop receiving new attributions but keep their existing history. |
How attribution works#
- The volunteer shares their link:
https://yourshop.com/raffle-slug/?vref=ABC123(or its QR code). - A customer clicks the link and lands on the raffle page.
- The referral code is captured into the WooCommerce session. It survives navigation across the site.
- When the customer adds tickets to the cart, the volunteer ID is pinned onto the cart item, so an outbound link click during checkout can’t rewrite the attribution.
- When the order completes and tickets are generated, each ticket is written to a side table (
wp_rfwc_pro_ticket_attribution) keyed byticket_idandvolunteer_id. The volunteer’s leaderboard count goes up.
Attribution is preserved even if the volunteer is later deleted — the history stays intact.
How ranges work#
If a volunteer has a range like [50, 100]:
- The visual ticket picker hides numbers outside that range (rendered as “sold” from the client’s point of view). Lucky Dip respects this automatically because it draws from the picker’s available set.
- Server-side validation rejects any pick outside the range, with a clear error to the customer. The check runs after the picker’s own validation and the reservation check.
- Two active volunteers can’t have overlapping ranges on the same raffle. The form blocks the save with an inline error.
Ranges are only enforced when a volunteer link is in the session. Customers who visit the raffle without a ?vref= see the full set of tickets as usual.
Leaderboard#
The leaderboard view shows all volunteers, sorted by tickets sold. Filter by raffle to focus on a single event, or leave the filter on “All raffles” for an organisation-wide view.
Each row shows the volunteer’s referral code, a copy-ready share link, and their tickets-sold total. The share link button opens the raffle URL with the ?vref= code already attached, ready to paste into an email, an SMS, or a poster QR generator.
Email notifications#
When Sale notifications is on for a volunteer:
- Each generated ticket triggers a short email to the volunteer’s address.
- The email includes the ticket number, raffle name, and order reference.
- Delivery uses
wp_mail. Notifications can be silenced per volunteer by unchecking the box.
The merchant’s normal raffle emails to the customer are unaffected.
Manual sales#
The Manual Ticket Sale module also supports volunteer attribution. When you record a face-to-face sale, you can pick the volunteer from a dropdown so the cash sale shows up on their leaderboard alongside online sales.
Data storage#
Two custom tables:
wp_rfwc_pro_volunteers— one row per volunteer (per raffle).wp_rfwc_pro_ticket_attribution— one row per attributed ticket. Unique constraint onticket_idprevents duplicates if the ticket generation hook fires twice.
Deleting a volunteer removes their record but keeps the attribution rows so historical reports stay accurate.
Developer notes#
| Hook | Type | Use |
|---|---|---|
rfwc_pro_volunteer_attributed | Action | Fires after a ticket is credited to a volunteer. Args: $volunteer_id, $ticket, $order. |
rfwc_pro_picker_sold_response | Filter | Lets the module inject out-of-range numbers into the picker’s “sold” list. |
The free plugin’s rfwc_ticket_generated action is what triggers attribution. The module hooks it at priority 20, after the Ticket Picker (priority 5) has finalised the ticket number.