Skip to main content

WooCommerce Raffle Tickets Setup

Written by Aldin Rey
Updated today

This setup allows customers to see the raffle ticket numbers they’ve earned after completing a purchase—both on the order confirmation page and within their account.

Already created your promotion? Skip to Step 9 for installation.


Requirements

Before you begin, make sure:

  • You’re using WooCommerce

  • All products and variants have unique SKUs

⚠️ If your variants don’t have SKUs, you must add them. Raffle tickets rely on SKUs to generate correctly.


Step 1: Create a promotion

  1. In ViralSweep, create a new promotion

  2. Select Purchases → WooCommerce


Step 2: Connect your store

If your store is already connected, it will appear at the top. Otherwise:


Get your store URL

  • Go to: WordPress → Settings → General

  • Copy the Site Address (URL)

Generate API keys

  1. Go to: WooCommerce → Settings → Advanced → REST API

  2. Click Add Key

  3. Enter:

    • Description: ViralSweep

    • Permissions: Read/Write

  4. Click Generate API Key

  5. Copy the Consumer Key and Consumer Secret

Paste these into ViralSweep to connect your store.


Step 3: Import your products

  1. Click Update Products

  2. Select 'Yes Proceed"

Your products and variants will appear on the right-hand side.


Step 4: Select qualifying products

Choose which products or variants apply to the raffle.

  • Only selected items will award raffle tickets

  • Non-selected products will not qualify

💡 If running multiple raffles, tickets can be assigned per product.


Step 5: Assign raffle tickets

For each qualifying product:

  1. Click the ticket icon next to the item

  2. Enter how many raffle tickets the purchase should award

💡 Tip: Name your SKUs or variants based on ticket quantity to keep things clear.


Step 6: Configure promotion settings

  • Add a promotion title

  • Set start and end dates

  • Choose the number of winners

  • Enable Raffle Tickets

  • Enter your Store URL


Step 7: Adjust entry settings

Since you’re using raffle tickets:

  • Set entries to 0 per $1 spent

This ensures users only receive raffle tickets—not standard entries.

If enabled, the widget will notify users when an order doesn’t qualify.


Step 8: Customize the widget

  • Upload images

  • Add your official rules

  • (Optional) Geo-target by country

  • Adjust widget styles in Design

  • Enable email notifications to send ticket numbers

Click Done to save your promotion.


Step 9: Install the widget (Checkout page)

We offer free installation. If you’d like help, invite [email protected] with editor access.


To install manually:

  1. Go to the Install tab in ViralSweep

  2. Copy the code under Step 1: Install to Checkout


Step 10: Add code to the order confirmation page

  1. In WordPress, go to:
    Tools → Plugin File Editor

  2. Select WooCommerce

  3. Open:
    templates > checkout > thankyou.php

Paste the widget code below:

“Thank you. Your order has been received”

💡 Placement may vary depending on your theme.


Step 11: Add global widget script

  1. Copy code from:
    Step 2: Install to Theme

  2. In WordPress, go to:
    Tools → Theme File Editor

  3. Open:
    Parts > Footer.html

  4. Paste the code at the top and save


Step 12: (Optional) Add to account page

If your store uses customer accounts:

  1. Copy code from:
    Step 3: Install to Account Page

  2. Go to:
    Tools → Plugin File Editor

  3. Select WooCommerce

  4. Open:
    templates > myaccount > dashboard.php

Paste the code below the “Hello” message.


Step 13: Test your setup

  • Place a test order

  • Confirm raffle tickets appear on the order confirmation page

  • Log into the customer account (if enabled) to verify tickets display correctly


Legal disclaimer

ViralSweep allows purchase-based sweepstakes and raffles, but laws vary by region.

You are responsible for ensuring compliance, including:

  • Local laws and regulations

  • Providing a free alternative method of entry, where required

For help with compliance in the U.S. or Canada, contact ViralSweep.

Did this answer your question?