1. Documentation /
  2. Lottery for WooCommerce

Lottery for WooCommerce

Lottery for WooCommerce is a full-featured lottery plugin for creating and managing online lotteries in your WooCommerce Shop.

Installation

↑ Back to top
  1. Download the lottery-for-woocommerce.zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
  3. Install Now and Activate the extension.

More information at: Install and Activate Plugins/Extensions.

Supported Lottery Types

↑ Back to top

Automatic Ticket Generation Lotteries

↑ Back to top

In this type of lottery, the ticket number will be automatically generated once the user participates in the lottery. The ticket details will be mailed to the user.

User selection lottery tickets Numbers

↑ Back to top

In this type of lottery, site admin can allow their users to choose their own ticket numbers for participating in the lottery. The ticket details will be mailed to the user.

Supported Winning Item Selection Types

↑ Back to top

Products Inside the Site

↑ Back to top
  • In this type, you can choose one or more products sold on your site as the Lottery Winning Item.
  • Once the Winner is decided(Automatically/Manually), an order will be created on behalf of the winner with the Winning Item for free of cost.
  • The product can be shipped to the winner in case if the product is a physical product. If the Product is a downloadable product, the winner will gain access to files.
  • The Lottery Winning Item can be accessed from the My Account Page > Orders similar to any other order.

Products Outside the Site

↑ Back to top
  • You can choose this type if your Lottery Winning Item is not sold on your site.
  • You may have to create a page which explains what the Winners will receive if they participate in the lottery and link that page’s URL in the URL option provided.
  • Once the winner(s) are decided, you will have to manage the process of sending the Winning Items to the Winners outside the site.

Setup and Configuration

↑ Back to top

Server Cron Configuration

↑ Back to top

Lottery for WooCommerce Requires Server Cron in order for the plugin to work. To setup Server cron do the following steps.
1. Login to the cPanel of your site
2. Locate “Cron Jobs” within the cPanel
3. Under the “Add New Cron Job” section, fill the following data

a. Common Settings

In this section, you can set up how frequently the Cron should run. For Example, if the value is set as “Once Per Minute”, then the cron will run once every minute. Once the cron is triggered, the following activities will be updated.

  • Starting Future Lotteries
  • Ending Closed Lotteries

b. Update Cron Command

wget -q -O – http://www.your-domain.com/?lty_lottery_cron=update

Plugin Settings

↑ Back to top

General

General Settings

  • Once the Plugin is installed, a page for displaying the lottery products will be automatically created and assigned. If you want to modify the page in which the Lottery products are displayed, you can do so by selecting a different page in the “Lottery Page” option.
  • The lottery products created will be displayed on the Lottery Page. The order in which the lottery products should be displayed can be customized in the “Default Sorting in Lottery Page”.
  • If you want to differentiate normal products from Lottery products, you can do so by adding a badge to the product image. To configure a badge, enable the “Enable lottery Badge” option.
  • By default, an image will be selected. If you want to change the badge icon, you can do so by choosing a new image.
  • By Default, the Lottery will reach “Completed” status when their payment order reaches “Processing or Completed”. If you want to customize the order status, you can do so by modifying the “Won lottery will reach “Finished” status when the Order Status of the Payment Reaches” option.
  • By default, all lottery products will be closed only when the end date has reached. If you want to close the lottery products once all the tickets have been sold, you can do so by enabling the “Close lottery when all the tickets have been sold”.

Automatic Random Ticket Generation Settings

  • You can configure the ticket attributes like Ticket Type, Prefix, suffix.
  • Please note this options not applicable for User selection lottery tickets Numbers type.

Lottery Display Settings

  • By Default, Lottery products will be visible in Shop page. If you want to hide the Lottery Products on the shop page, you can do so by enabling “Hide Lottery Products on Shop Page”.
  • By Default, Lottery products will be visible in Category page. If you want to hide the Lottery Products on the category page, you can do so by enabling “Hide Lottery Products on Category Page”.
  • By Default, Lottery products will be visible in Tag page. If you want to hide the Lottery Products from the tag page, you can do so by enabling “Hide Lottery Products on Tag Page”.
  • By Default, Finished Lottery products will be visible in Shop & Category Pages. If you want to hide the Finished Lottery Products from the Shop and Category Pages, you can do so by enabling “Hide Finished Lottery Products on Shop & Category pages”.
  • By Default, Failed Lottery products will be visible in Shop & Category Pages. If you want to hide the Failed Lottery Products from the Shop and Category Pages, you can do so by enabling “Hide Failed Lottery Products on Shop & Category pages”.
  • By Default, Closed Lottery products will be visible in Shop & Category Pages. If you want to hide the Closed Lottery Products from the Shop and Category Pages, you can do so by enabling “Hide Closed Lottery Products on Shop & Category pages”.
  • If you want to display a progress bar on the Single Product Page, you can do so by enabling “Display Progress Bar”.
  • By Default, the Remaining Ticket Info will be visible in the Progress Bar. If you want to hide the Remaining Ticket Info in the Progress Bar, you can do so by enabling the “Hide Remaining Ticket Info message in the Progress bar”.
  • By Default, Countdown Timer will be visible in the Single Product Pages. If you want to hide the Countdown Timer, you can do so by enabling “Hide Countdown Timer for Single Product Pages”.
  • By Default, the Lottery Start Date will be visible on the Shop Page. If you want to hide the Countdown Timer, you can do so by enabling “Hide Lottery Start Date on Shop Page”.
  • By Default, the Lottery End Date will be visible on the Shop Page. If you want to hide the Countdown Timer, you can do so by enabling “Hide Lottery End Date on Shop Page”.
  • By Default, the Lottery Start Date will be visible on the Single Product Page. If you want to hide the Countdown Timer, you can do so by enabling “Hide Lottery End Date on Single Product Page”.
  • By default, the Countdown timer for the Lottery will be displayed. If you want to hide the Count-down timer, enable the “Hide Countdown timer for the Lottery Products in Shop and Category Pages” option.
  • By default, the bidder name will be masked and displayed. If you want to display the name of the bidder, disable the “Mask the user name in Ticket Logs tab on the Single product page” option.
  • By Default, Timezone Info will be visible in the Single Product Page. If you want to hide the Timezone Info, you can do so by enabling “Hide Timezone info in the Single Product Page”.
  • By Default, Minimum Ticket Info will be visible on the Single Product Page. If you want to hide the Minimum Ticket Info, you can do so by enabling “Hide Minimum Ticket info in the Single Product Page”.
  • By Default, Maximum Ticket Info will be visible on the Single Product Page. If you want to hide the Maximum Ticket Info, you can do so by enabling “Hide Maximum Ticket info in the Single Product Page”.
  • By Default, Minimum Tickets per user info will be visible on the Single Product Page. If you want to hide the Minimum Tickets per user info, you can do so by enabling “Hide Minimum Tickets per user info in the Single Product Page”.
  • By Default, the Winner Message will be visible on the Single Product Page. If you want to hide the Winner Message, you can do so by enabling “Hide Winner Message on Single Product Page”.
  • By Default, Lottery Status will be visible in the Shop and Category Page. If you want to hide the Lottery Status, you can do so by enabling “Hide Lottery Status on Shop and Category Pages”.
  • By Default, Lottery Status will be visible on the Single Product Page. If you want to hide the Lottery Status, you can do so by enabling “Hide Lottery Status on Single Product Page”.
  • By Default, the Lottery Tickets Sold count will be visible on the Single Product Page. If you want to hide the Lottery Tickets Sold count, you can do so by enabling “Hide Lottery Tickets Sold on Single Product Page”.

Q&A Settings

  • If you want to ask a Question to your users before purchasing a ticket, you can do so by enabling the “Ask a Question before Purchasing Tickets”.
  • By default, the user will not be forced to answer the Question to purchase a ticket. If you want to force your users to answer the question, you can do so by enabling the “Force Users to Answer the Question”.
  • By default, the user will be allowed to purchase a ticket once they select an answer. The answer will not be verified. If you want to allow your users to purchase tickets only when a correct answer is selected, enable the “Verify Answer Purchasing Lottery”.
  • By default, if your users answer incorrectly for 1 time, they will not be allowed to participate in that lottery. You can customize the limit to any value you want or you can set it to unlimited.
  • In the “Your Question” option, input the question which you want to ask your users.
  • To add answer options, click the “Add Answer Options” button. You can mark the correct answer by selecting the “Correct Answer” checkbox next to the answer. You can add any number of options.

Advanced

General
  • By Default, multiple users from the same IP Address can participate in a lottery. If you want to prevent multiple users from the same IP participating in the lottery, you can do by enabling the “Restrict user to purchase lottery ticket based on IP address” option.
  • By default, guest users can participate in the lottery but, they will be forced to create an account in the checkout page. But, if you want to prevent the guest users from participating in the lottery, you can do so by modifying the “Guest User Participation Type” and setting it to “Prevent Guest Participation” option.
  • By default, when users choose a ticket number and add the product to the cart, they can complete the purchase whenever they want. If you want to place a time limit within which the purchase has to be completed, you can do so by enabling the “Reserve Ticket number Till Purchase Completion”. You can customize the reservation duration in the “Ticket Reserve Duration in Minutes”.
  • If you want to disable the “Participate Now” till the user answers the question and selects the ticket number, enable the “Disable Participate Now button when Question Answer and Ticket Number not Selected” option.
  • You can customize the file name of the Export CSV file in the “Export CSV File Name” option.
  • There are 2 types of Crons

1. WP Cron

WP Cron is supported in all WordPress sites by default(Unless turned off manually in the wp-config file). The main disadvantage of WP Cron is that it will trigger only when someone visits the site. For example, If there is no site activity for some time say 10 days, the cron will not be triggered on those 10 days.

2. Server Cron

Server Cron is an alternate to WP Cron. The main advantage of Server Cron is that it is not dependent on site activity. But, Server Cron requires separate configuration. As far as we know, it cannot be configured using a Plugin within the site. It can only be configured from the site’s C-Panel or control panel.

If you want to use WP Cron, then in “Select Cron Type” select “WP Cron”. If you want to run Server cron, select “Server Cron”. Please follow the steps mentioned in the “Server Cron Configuration” section.

Color Customization

You can customize the color of the lottery elements in Single Product Page, Shop, Category and Tag Pages.

Shortcodes

In this section, you can find the supported shortcodes along with their purpose.

Notifications

In this section, you can find the supported email notifications. Notifications can be turned On/Off as per preference.

Localization

In this section, the labels displayed for the Lottery products can be customized.

Messages

In this section, the messages displayed while interacting with Lottery Products can be customized.

Product Configuration

↑ Back to top
  • Once the initial configuration is completed, a Lottery Product has to be created.
  • To create a new product go to WordPress Dashboard > Products > Add New
  • In the Product Type selection, select “Lottery”
  • In the “Lottery” section, fill in all the fields.
  • By default, the ticket number will be automatically generated. If you want your users to choose their own ticket number, you can do so by enabling the “Allow Users to Choose Ticket Numbers” checkbox.
  • If you choose to generate tickets automatically, the ticket numbers can be generated in the following patterns,
    i. Random – Ticket numbers will be generated randomly.
    ii. Sequential – Ticket numbers will be generated in sequential order. The Starting Number, Prefix and Sufix can be customized.
    iii. Shuffled – Ticket numbers will be shuffled and assigned to the user. The Starting Number, Prefix and Sufix can be customized.
  • If you want to provide your users with the flexibility of the Lottery System randomly picking a ticket number for them by clicking a button during lottery purchase, then enable the “Enable Lucky Dip” checkbox.
  • In the “Number of Tickets per Tab” option input how many tickets should be displayed per tab.
  • By default, the winner of the lottery will be automatically decided. If you want to manually pick the winner for the lottery, you can do so by customizing the “Winner Selection Method” option.
  • Configure the Winning Item Selection Method as per your preference.
  • By default, When Q&A is enabled and configured, it will apply to all the lottery products. If you want to customize the Q & A for a particular Product, then locate the “Q&A” section.
  • In Question Answer Level Selection Type select “Product Level”.
  • Enable the “Ask a Question before Purchasing Tickets” checkbox.
  • If you want to force your users to answer the question before participating, enable the “Force Users to Answer the Question” checkbox.
  • Enter your question in the “Your Question” field.
  • You can provide any number of options you want to your users. To add an option, click the “Add Answer Options” button.
  • To set the correct answer, enable the “Correct Answer” checkbox next to the option.
  • You can optionally offer multiple tickets for a single price. To configure navigate to Predefined Buttons section.
  • Enable the Enable Predefined Buttons checkbox.
  • In Select Discount Type select the type of discount you wish to offer.
  • In the Ticket Quantity, input the number of tickets which has to be purchased by the user. In the Discount field, input the discount value.
  • You can create any number of buttons for a single product.
  • You can offer Instant Win Prizes to your users for purchasing lottery tickets. The settings for the Instant Win Prizes can be found in the Instant Win Prizes section.
  • Instant Win Prize is applicable only for “Automatic Ticket Generation” type.
  • Enable the Instant Win Prize checkbox.
  • Fill in the eligible ticket numbers one number per row and the information on the gift the user will be receiving.
  • Once you have completed the configuration, publish the product.

Usage

↑ Back to top

Automatic Winner Selection

↑ Back to top
  • A user lands on the single product page. The user selects the number of tickets they wish to purchase and adds the product to the cart.
  • The users can also manually select the ticket number(s)/Allow the system to select a ticket for them(Based on Configuration).
  • Once the purchase is completed and the payment has been received, the users will receive the ticket number(s).
  • Once the Lottery end date has been reached, the winner will be automatically picked by the system and they will be notified via email.
  • If the winning item is configured “Products Inside the Site”, then the product associated with the lottery will be added to the user’s account in a separate order for free of cost.

Manual Winner Selection

↑ Back to top
  • A user lands on the single product page. The user selects the number of tickets they wish to purchase and adds the product to the cart.
  • The users can also manually select the ticket number(s)/Allow the system to select a ticket for them(Based on Configuration).
  • Once the purchase is completed and the payment has been received, the users will receive the ticket number(s).
  • Once the Lottery end date has been reached, the admin will be notified via email. The site admin will have to manually pick the winner(s).
  • If the winning item is configured “Products Inside the Site”, then the product associated with the lottery will be added to the user’s account in a separate order for free of cost.

Lottery Dashboard

↑ Back to top

Admin Dashboard

↑ Back to top
  • To access the Admin Dashboard go to WordPress Dashboard > Lottery > Lottery
  • From this dashboard, the Site Admin can view the following data
    1. Status of the Lottery
    2. Minimum and Maximum Tickets for a lottery
    3. Number of Tickets sold in a lottery
    4. Number of Participants in a lottery
    5. Lottery Winning Type and Number of winners in a lottery
    6. Admin can manage and see more details in each lottery
    7. Admin can export the Lottery Details as a CSV File.

Customer Dashboard

↑ Back to top

To display the customer dashboard, place the shortcode “ [lty_dashboard]”. Your Customer can access the following Details from the Customer Dashboard,

  1. List of Participated Lotteries
  2. List of Won Lotteries
  3. List of Lost Lotteries

Widgets

↑ Back to top

To configure the Wallet Widgets go to WordPress Dashboard > Appearance > Widgets. The following Widgets are Available,

Lottery Products

↑ Back to top

Displays the Lottery Products. The Following Filters are Available

  • Future Lottery
  • Running Lottery
  • My Lottery

Lottery Search

↑ Back to top

Displays the Lottery Product Search Widget.

Translation

↑ Back to top

Lottery for WooCommerce is translation ready, meaning you can edit the po files by which you can translate the text to any language. Steps to perform the translation are as follows. For example, a translation to French.

  • Download and install Poedit
  • Open the file lottery-for-woocommerce > languages > lottery-for-woocommerce.pot using Poedit.
  • Create a new translation file by clicking Create new translation button.
  • Choose the Source text and set its corresponding French text in Translation Text Area.
  • Save the changes.
  • Save the file name as lottery-for-woocommerce-fr_FR.po.
  • If you are using WordPress Version 3.9.13 or below, then in wp-config.php define the WPLANG as French. Syntax is define(‘WPLANG’, ‘fr_FR’);
  • If you are using WordPress Version 4.0 or above, then go to WordPress dashboard > Settings > General and select the Site Language as French.
  • 30-day money-back guarantee
  • Support teams across the world
  • Safe and secure online payment