Here you can find answers to frequently asked questions. Feel free to contact us if you can’t find answer to your question.
- Can users create their own lotteries? – Basically yes, only users who can add new products can create lotteries. You can use multiple vendor plugin which will allow you to add users who will be able to create products (lotteries). You can use multiple vendor plugin which will allow you to add users who will be able to create lotteries. You can use WooCommerce Product Vendors (there is no frontend submission for lotteries only backend).
- Do you use cronjobs? Why do we use cronjobs? – Yes. Please check installation instructions. WordPress cronjob is run on every visit (page load), it’s fine for small and not so busy websites. But sometimes you do not have enough hits (visitors) and lottery will be finished when visitor loads page (and cronjob) instead on its end timestamp. That’s why we use real cronjobs – to make sure your lotteries will end on time. Also on busy websites you need to turn off WordPress cron and create cronjob for it to avoid cron being loaded on every hit and generating performance penalty.
- Where can I edit email templates? – Go to WooCommerce > Settings and click on Emails tab.
- Does this plugin work with caching plugins? – Yes, W3TC and WP Super Cache work but we advise no caching for logged in users. For example if page cache is enabled widget recently viewed lotteries will not work. Once user is logged in and there is no caching anymore all widgets will work. You can use CDN and browser caching. Our plugin demo website uses WP Super Cache with page caching and browser caching. All of our plugins have same requirements for caching as WooCommerce – check it here https://docs.woocommerce.com/document/configuring-caching-plugins
- Can I make theme with WooCommerce Lottery and sell it on ThemeForest? – Sure, just purchase extended licence and you’re good to go.
Since the current licenses do not deal with re-selling Items, Envato lets authors to decide whether they grant permission for bundling Items or not. We have the following conditions, and you need to follow them:
- You cannot redistribute the item “as-is”, even if you modify it or you make a derivative version for another platform
- You cannot offer the plugin as a stand-alone item
- You cannot include the plugin separately from your theme in the download package
- You cannot provide an Item Purchase Code for your customers – Since Envato doesn’t have a “multi-use” or transferable license, your customers are not entitled to receive an Item Purchase Code with your theme and use the plugin separately from your work.
- Updating the plugin is your own responsibility
- Since your customers cannot receive updates from us, you need to handle this on your own
- You need to handle related support requests after your customers or you can instruct them to buy regular licence and ask us for support directly via our CodeCanyon profile (we cannot provide free support for your customers)
- I can’t do anything because I get “out of stock message”? – Lottery plugin needs inventory / stock to be enabled. If you have problems all issues should be fixed by upgrading to WooCommerce Lottery v1.1.6
- How can I update plugin with new version? Is auto updating possible? – We suggest you to install Envato Marketplace (installation instructions can be found on plugin’s url) plugin for auto update plugin and themes purchased on Envato. Setup is easy. Manual updating can be done by downloading new version of plugin and overwrite old files with new ones or deleting old plugin and installing new one. If you have Pick Number Mod addon login to https://wpgenie.org/my-account/downloads download latest ZIP, then remove old plugin and upload new plugin (ZIP).
Note:
If you have modified plugin files (templates) then you need to be careful when updating so you don’t overwrite changes you made and that templates are inside child theme or theme woocommerce/ template folder.
- Does WooCommerce Lottery work with WordPress import / export tools? – Yes, you can export and import lotteries with standard WordPress import / export tools that are located in Admin -> Tools menu.
- How can I enable user registration on login page? – You need to enable that feature in WooCommerce settings.
- I have installed your plugin but images are not aligned, buttons are too small / big, input fields needs to be smaller / bigger, can you help? – In short no.
It’s your duty to modify plugin template to matchyour style and theme. Themes can implement different ways how they customize pages and parts of WooCommerce. We cannot guarantee that our plugin will look same as in our demo for every possible theme out there. Web developing is more than getting a theme and couple plugins, enabling them and deliver web site. Our templates are coded by standards and they adhere to WordPress and WooCommerce template structure. That means that minimal intervention is needed from client side, but sometimes there is no way to avoid template changes. Some themes use similar structure and have minimal interventions in structure and our plugin looks good out of the box and some do not. It’s your task as web developer and client who purchased plugin to modify and customize plugin templates to match your own (or client’s) needs and styles. This is part of developing a web site. You cannot expect that everything will be perfect for every possible theme and plugin comibation out there or that we will do your job for you as part of support. We support plugin – we do not style and customize client’s sites. Thanks for understanding.Note:
Right way to customize plugin’s templates is to copy contest of plugin_dir/woocommerce-simple-lotteries/templates/ directory to your_theme/woocommerce/ directory and do modifications there.
When you ask us for support make sure it’s not related to tasks we don’t do as part of support:
– style or customize your theme to do this or that
– provide support for bugs caused by 3rd party plugins or themes (we can pinpoint that some plugin is problematic)
– send you CSS or HTML code for modifying html elements - Where can I see winners of the lottery? – Read text and check screenshots in paragraph “Plugin options”.
- How can I add countdown timer / progress bar on all pages (product loop and product archive) not only on single product page? –
You can download and install small plugin for that called WooCommere Lottery Progress Bar in Product Loop.
We have also code snippets for that https://pastebin.com/gavzf7bz and https://pastebin.com/FBwvXp7N You can use code here or the code below:add_action( 'woocommerce_after_shop_loop_item_title', 'wpgenie_show_counter_in_loop', 50 ); function wpgenie_show_counter_in_loop(){ global $product; $time = ''; if(!isset ($product)) return; if('lottery' != $product->get_type()) return; $timetext = __('Time left', 'wc_lottery'); if(!$product->is_started()){ $timetext = __('Starting in', 'wc_lottery'); $counter_time = $product->get_seconds_to_lottery(); } else{ $counter_time = $product->get_seconds_remaining(); } $time = ''.$timetext.' '; if($product->is_closed()){ $time = ''.__('Lottery finished','wc_lottery').''; } echo $time; }
- How winner(s) is picked? How do you pick winners? – Detailed explanation is here
- Can users buy tickets for lotteries without signup / register first? – From Lottery version v2.1.5 login at later stage of checkout (guest checkout) is possible. It is enabled by default in settings and can be disabled.
- What are custom meta fields for lottery product type (useful for CSV Product Import)?
_lottery_closed _lottery_dates_from _lottery_dates_to _lottery_started _lottery_has_started _lottery_multiple_winner_per_user _lottery_num_winners _lottery_participant_id _lottery_participants_count _lottery_price _lottery_winners _lottery_fail_reason _max_tickets _max_tickets_per_user _min_tickets _participant_id _lottery_wpml_language
- 3rd party plugin is causing problems? Its developers tell you that we need to fix our plugin? – WooCommerce extensions should be transparent – meaning one extension should work with another without introduction of special code that makes them compatible. Imagine what would happen and how much time we would need to spend if we would have to add a bit of compatibility code for every WooCommerce extension that’s out there – we would end up in huge plugin with tons of problems which would be problem to test and debug. That’s why we think every plugin developer should stick to WooCommerce coding standards and APIs (they’re there for that reason) and not require 3rd party developers to code something into their extensions / plugins so that it could work with theirs.
- How can I translate plugin to my language? Do you have translations? – We only maintain english translation. We do not have resources to quality maintain other translations. Here are steps which can help you to traslate plugin or change some strings yourself:
- you will use file plugins/woocommerce-lottery/languages/wc_lottery.pot to create your translation
- you need to download and install Poedit https://poedit.net/download
- download wc_lottery.pot and open it with Poedit
- do your translations with Poedit
- when done save wc_lottery-en_GB.po, saving wc_lottery-en_GB.po will create wc_lottery-en_GB.mo
- you need to upload both files to /wp-content/languages/plugins/ and not to plugin directory because translations will be lost if you update plugin by deleting old one
In case you need to replace string lottery with competition please contact us to get PO/MO translation files with changed strings.Note:
In filename wc_lottery-en_GB.po suffix en_GB must match your language settings in WordPress, otherwise language will not be loaded. So for example you can have wc_lottery-en_AU.mo, wc_lottery-af.mo or wc_lottery-en_CA.mo, complete list of available suffixes are here https://make.wordpress.org/polyglots/teams/
- I want to remove countdown timer on single lottery page, what should I do? To do that just create empty file called lottery-countdown.php in your_child_theme\woocommerce\global\ folder. If you want to modify or edit element from that template you need to copy its content from original template plugins\woocommerce-lottery\templates\global\lottery-countdown.php to modified one which should be also in your_child_theme\woocommerce\global\lottery-countdown.php folder.
- When client cancelled order stock is not restored? – Stock has to be restored, otherwise contact us and open support ticket.
- Can I manually add winning numbers? Can I enable users to pick ticket numbers? Can I have question – Yes, you will need Pick ticket numbers addon / extension avaliable (for a fee) – check demo and screenshots – please contact us for more details via ticket system or email info@wpgenie.org – features included: ticket pick option, question / answers, manually pick winning number(s) – when you want to use 3rd party lottery drawing option like national lottery numbers, service like random.org or your own random number generator
- What happens with tickets with wrong answer? – When you manually select winner you can select also winner with wrong answer. When winner is selected automatically then tickets with wrong answers will not be taken into draw process.
- List of actions and filters – Here is list of all actions:
wc_lottery_close wc_lottery_fail wc_lottery_min_fail wc_lottery_won pre_get_lottery_search_form woocommerce_product_options_lottery lottery_product_save_data woocommerce_lottery_do_relist woocommerce_lottery_do_extend wc_lottery_participate_added wc_lottery_participate_not_added wc_lottery_participate wc_lottery_cancel_participation wc_lottery_cancel_participation_failed wc_lottery_delete_participate_entry woocommerce_refund_processed woocommerce_order_partially_refunded woocommerce_order_fully_refunded woocommerce_lottery_started woocommerce_before_shop_loop woocommerce_after_shop_loop woocommerce_email_header woocommerce_email_footer woocommerce_lottery_before_participate woocommerce_lottery_ajax_change_participate woocommerce_lottery_participate_future woocommerce_before_add_to_cart_button woocommerce_after_add_to_cart_button
Here is list of all filters:
Typos in actions and filters are ok and they all work.woocommerce__lottery_history_data woocommerce_lottery_history_heading lottery_history_started_text lottery_history_starting_text lotery_add_participants_from_order lotery_remove_participants_from_order woocommerce_order_fully_refunded_status woocommerce_lottery_participants woocommerce_lottery_winners woocommerce_lottery_history woocommerce_lottery_participating_message get_lottery_search_form woocommerce_lottery_bage woocommerce_product_add_to_cart_text woocommerce_product_single_add_to_cart_text woocommerce_lottery_participating_message woocommerce_shortcode_lotteries_query woocommerce_shortcode_products_query_results widget_title time_text get_lottery_search_form woocommerce_email_footer_text woocommerce_quantity_input_min woocommerce_quantity_input_max
- Refund feature does not work? How can I tell if my payment gateway supports refunds? If you got this error: “Payment does not support refund” your gateway just does not implement refund feature. Here is link for more infos about how to check if gateway supports refund feature. Keep on your mind that for issuing refund you need to click on refund button in product details, there are not automatic refunds.
- How can I create custom query for lotteries? You can use this code:
Also you can check this paste here.// Return active lottery products. $args = array( 'post_type'=> 'product', 'show_past_lottery' => FALSE, 'tax_query' => array(array('taxonomy' => 'product_type' , 'field' => 'slug', 'terms' => 'lottery')), ); // Return past lottery products. $args = array( 'post_type'=> 'product', 'show_past_lottery' => TRUE, 'tax_query' => array(array('taxonomy' => 'product_type' , 'field' => 'slug', 'terms' => 'lottery')), 'meta_query' => array( array( 'key' => '_lottery_closed', 'operator' => 'EXISTS', ), ), ); $the_query = new WP_Query( $args );
- I want to export order(s) data. How can I do that? – There are plugins that allow exporting of various order data as CSV file which you can then import to some other software you use for order management. We can suggest Advanced Order Export For WooCommerce. These plugins work with custom product types which are used in this plugin. There is also option to go to lottery details, scroll down to Lottery history block and literally copy / paste everything to excel or other table calc file.
- Can users create their own lotteries like for example on eBay? Can I charge fee for lottery ticket sales published by users? – Yes but you need 3rd party plugin for implementing WooCommerce multivendor / marketplace. Then your users will be able to post lotteries and you can charge fee for their sales. You can use Dokan multivendor plugin which has frontend lottery submissions (you need Business version or Free, Starter, Professional with Dokan WooCommerce Lottery Integration module) or Woo Product Vendors.
- Do you recommend any credit / wallet plugin for WooCommerce that works with this plugin? – Yes, you can use TeraWallet plugin which adds new credit payment gateway and works with our plugin just fine. Users or admins can top up wallet credit balance with regular payment gateways or manually. With Pick Number it is possible to custom code feature that instant wins are automatically credited to TeraWallet for winning user.
- I’m using pick ticket number mod but do not use tickets only option to manually enter winners. What means number you enter in that case? – When you do not use ticket numbers, number you enter in manual pick is in fact position in array of tickets which is generated when order for ticket is created. Since it is array you can enter 0 which is 1st element from array. Position in participant array is defined by order completed timestamp so orders made earlier will be on the beginning of the array of participants. Base lottery number works same – it just uses mt_rand function to generate number which is then used to choose winner(s).
- I’m using pick ticket number mod and I want to know what happens with tickets who have wrong answers? – If you use automatic draw and allow false answers all tickets will get into the draw. If you select “allow only true answers” option then tickets with wrong ones will not get into the draw.
- Product type column vanished in Woo product list, how can I get it back? – From WooCommerce 3.4.0 update, Woo developers removed that column in product list (as a result of users’ feedback). There is way to restore it back using this plugin https://wordpress.org/plugins/woocommerce-product-type-column/
- How can I hide usernames in lottery history list? – You need to edit template. First copy template woocommerce-lottery\templates\single-product\tabs\lottery-history.php to your_theme\woocommerce\single-product\tabs\lottery-history.php and edit file in that directory so update doesn’t override your changes. Then find and remove / edit lines (or comment them out) 28-39.
- I want to relist / extend lottery and keep all current participants? – You can do that using “Extend Lottery” button. Make sure to have latest version of Lottery plugin and once lottery fails (for any reason) you will have both options – to relist it (restart with no participants) and to extend end date keeping all current participants (and their orders). Only failed lotteries can be extended while all finished lotteries can be relisted.
- Is there a way when a participant buy the ticket(s) for lottery to make it automatically participate to another one? Is there option when a customer buys a product to make that customer also a participation for a lottery? – No, plugin does not support that feature. However you can issue customer coupon code which they can use to participate in lottery for free, you can use some more advanced coupon code manager like Smart Coupons.
- How can manually add order and get ticket numbers assigned? Can I add free of charge order? – For ticket numbers you need Pick Number Mod addon for WooCommerce Lottery. You can add order manually from wp-admin like for regular products or you can use “login as user” plugin and go through checkout process as that particular user you want to add order for (if you want to add order for free you will need to create coupon code you can use to discount order). Also check tutorials with videos https://wpgenie.org/tutorials-category/woocommerce-lottery-with-pick-number-mod-how-to-manually-add-order
We have new tutorial how to manually add order from WooCommerce Orders > Add New – check it here. - How “Use alphabet?” works in Pick Number mod addon? – When enabled your numbers will be partitioned with A-Z letters using parameter “tickets per tab”. Example you have 1000 tickets and 500 tickets per tab results is parition A1 – A500, B1 – B500. If you do not set “tickets per tab” or enable “randomly assign ticket number” addon divide max number of tickets with 26 and you will have tickets with all 26 letters (for say 7800 tickets last ticket will be Z300, since 26 letters * 300 numbers give 7800 tickets total).
- I want to have orders marked as completed automatically, should I use plugin or? – If you set lottery to be virtual and downloadable it will be marked as completed upon successful payment. You don’t need to set file download for downloadable product just leave that part empty. There are also plugins which automatically mark orders as completed.
- Can I clone or duplicate lottery product to create new one? – No, lotteries should not be cloned because all custom meta will be cloned too and that can cause issues. You can relist lottery instead. Best way to creatw new lottery is to go add new lottery product from scratch. If you need to automate this please use import tool and consult documentation about custom meta fields (FAQ item no 15).
- Lottery accidentally finished and I’m unable to extend it – is there anything I can do to retain all participants and extend lottery end date? – Best would be to refund all users or give them coupon code to enter new lottery for free. Brute force solution (you need to edit values in database or edit custom meta fields using plugin like JSMâs Show Post Metadata!): you can change end date and then remove these custom postmeta for particular lottery product (search by post ID in table wp_postmeta!): _lottery_closed, _lottery_fail_reason, _lottery_winners. Custom postmeta value explanation:
_lottery_closed values: 1 – fail, 2 – finished
_lottery_fail_reason: 1 – There were no participants, 2 – The item did not make it to minimum participants - I’m using Lottery Pick Number mod addon and I want to have picture with puzzle instead of question. Is that possible? – Yes it is. Upload picture with your puzzle, add it to question input box using HTML img tag and enter couple of answers marking right one with checkbox. See screeshot below with example code:
- I’m using Lottery Pick Number mod addon and I want to auto relist lottery. Is that possible? – Auto relisting is only possible with Pick Number Mod addon. You need to set auto relist parameters and setup cronjob https://domain.com/?lottery-relist=true
- How can I create Entry Lists page? – Please read this quick and easy tutorial.
- I’m using cache plugin in WordPress with option for object cache – how should I setup it? – If you use object cache you will need to add group wc_lottery to a list of non presistent groups, below is screenshot from W3 Total Cache object cache settings page:
Other plugins have similar option like https://objectcache.pro/docs/ignoring-groups/ or https://github.com/rhubarbgroup/redis-cache/wiki/Configuration-Options. WP Rocket, WP Super Cache and WP Fastest Cache do not use object cache (only page caching and that should be disabled for logged in users). On some hosting providers it is possible that hosting has set up serverwide object cache (in order to have as much clients as possible on same hardware resources) and if you experience issues you might have to check with your hosting support if something like that is implemented in their hosting enviroment. We use wp_object_cache functions which by default is non-persistent. This means that data stored in the cache resides in memory only and only for the duration of the request. Cached data will not be stored persistently across page loads unless you install a persistent caching plugin. When you install 3rd party object cache, you override this cache and you get persistent object cache. That is why we suggest excluding wc_lottery domain from it. We do this to avoid duplicate SQL queries in same request. So default behaviour is that cache is valid only for single request (non persistent).define( 'WP_REDIS_IGNORED_GROUPS', ['counts', 'plugins', 'wc_lottery'] );
- How can I sort lotteries in My Account > My Tickets section? – You can use this code snippet https://pastebin.com/6iuzQ2bR
- I’m using Lottery Pick Number mod addon and I want to rename ticket numbers to be for example names of football teams: Arsenal, Man Utd, Man City… Can I do that? – Yes, ticket numbers can be renamed using filter. For details please open support ticket.
- Does Pick Number Mod addon support instant win number? – Yes, you can define ticket numbers that are instant win numbers (available in Pick Number Mod version v2.3.0). You can download latest version here.
- I’m getting fatal error on Edit Lottery > Lottery History block? – Make sure you don’t use WooCommerce Upsell Popup pluign. For some strange reason this plugin destroys $product object Edit Lottery and then our plugin cannot access it anymore hence the error.
- List of actions and filters for Pick Number Mod addon – Here is list of all actions:
Here is list of all filters:woocommerce_lottery_duplicate_ticket_in_order_found woocommerce_after_adding_extra_info remove_participants_if_wrong_answer woocomerce_before_relist_lottery woocomerce_after_relist_lottery wc_delete_lottery_history_csv wc_lottery_instant_won wc_lottery_before_ticket_numbers
woocommerce_lottery_participants woocommerce_lottery_get_lottery_participants woocommerce__lottery_history_data woocommerce_lottery_history_heading ticket_number_display_html ticket_number_tab_display_html lottery_history_started_text lottery_history_starting_text woocommerce_lottery_export_dir_path woocommerce_lottery_export_filename woocommerce_lottery_export_fields wc_lottery_generate_random_ticket_numbers lottery_numbers_to_alphabet_number_per_letter change_ticket_numbers_to_alphabet wrong_answer_display_item_meta woocommerce_lottery_my_tickets_endpoint_query_args woocommerce_lottery_my_tickets_past_endpoint_query_args woocommerce_lottery_entry_list_query_orderby woocommerce_lottery_start_ticket_number
- I have problems when importing and editing 1000s of instant wins. What can I do? This problem arises due to default value of 1000 for max_input_vars php limit. You need to raise that in php.ini to say 3000 (contact your hosting support for help).
- How can I recheck instant wins and populate its table? You can run URL https://your-website.com/?lottery-instant-winners-check=true which will then recheck instant wins.
- List of custom meta fields for Pick Number Mod addon – Here is list of all meta fields for Pick Number:
_lottery_pick_number_alphabet _lottery_use_pick_numbers _lottery_pick_numbers_random _lottery_pick_number_tab_qty _lottery_manualy_winners _lottery_winners _lottery_instant_instant_winners _lottery_instant_win _lottery_instant_ticket_numbers_prizes _lottery_instant_ticket_numbers_prizes_e _lottery_instant_win_main_competition _lottery_pn_winners _lottery_pn_answers
- How can I sort tickets by ticket number in lottery history tab? You can use this code snippet for that purpose https://pastebin.com/KAqexYKn.