=== CompKit Ticket Machine ===
Contributors: kriscreates
Tags: woocommerce competition, raffle, prize competition, instant win, ticket numbers
Requires at least: 5.6
Tested up to: 6.8.3
Tested up to WC: 10.3.5
Requires PHP: 7.4
Stable tag: 1.13.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Run ticketed prize competitions on WooCommerce, and drive the CompKit Game Engine games from them.

== Description ==

CompKit Ticket Machine turns a WooCommerce product into a ticketed prize competition. Each
purchase issues real ticket numbers, entries are listed publicly, winners are drawn manually
or automatically, and instant-win prizes can land the moment a ticket is bought.

It is the ticketing half of CompKit. The CompKit Game Engine and its game modules - spin the
wheel, scratch card, slots, darts, football, race car, grab claw, balloon pop - read the
instant-win result this plugin records and turn it into something the customer plays.

= Core features =

* Competition product type - start and end dates, unlimited-duration competitions, minimum
  and maximum ticket counts, per-user limits, and a fail threshold with automatic refunds.
* Ticket numbers - sequential or random generation, configurable ticket length, manual ticket
  picking, lucky dip, and a per-order ticket summary.
* Instant wins - prize groups, per-competition rules, coupon and product prizes, and a full
  instant-win log. This is what the CompKit games reveal.
* Winners - manual selection, automatic draw on end date, multiple winners, gift products for
  winners, and a winners-list shortcode.
* Entry lists - a public entry list page per competition, searchable, with PDF download.
* Relisting - automatic relisting of finished or failed competitions, with schedules.
* Question gate - require a correct answer before a customer may enter, timed or untimed.
* Customer dashboard - a My Account section for tickets bought, competitions entered, won and
  lost, and instant-win prizes.
* Emails - competition started, ended, extended, relisted, failed, ticket confirmation,
  winner, no luck and instant winner, for both customer and admin.
* PDF tickets - branded ticket and entry-list PDFs.
* Shortcodes - competition grids, winners lists, entry lists and per-product blocks.
* Import/export - instant-win rules and prize groups.
* Site credit - pay instant-win prizes as credit. Customers spend it at checkout (part or
  all of an order, classic and block checkout) and can ask to withdraw it by PayPal or bank
  transfer; you pay and mark it paid. Reads the balances already held by Wallet for
  WooCommerce or CompKit Wallet, so nothing is lost when you switch.
* Spending limits - customers cap what they spend per day, week, month or year, or take a
  break from buying, in My Account. Enforced at classic and block checkout, with an activity
  log and CSV export for the shop. Built on Spending Limits for WooCommerce by WPGenie
  (GPLv2 or later); customers' existing limits and breaks carry straight over.
* Compatible with HPOS (custom order tables), Cart & Checkout blocks, WPML, Multi Currency,
  Stripe, Square, WooCommerce Payments, Smart Coupons, Store Credit and wallet plugins.

= Requirements =

* WordPress 5.6 or newer
* WooCommerce 3.0 or newer
* PHP 7.4 or newer

== Installation ==

1. Upload the `compkit-ticket-machine` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Go to Competition -> Settings to configure.

Important: CompKit Ticket Machine cannot run alongside "Giveaway (formerly Lottery) for
WooCommerce". The two share the same database tables, functions and post types. Deactivate
that plugin first - every competition, ticket, winner and instant-win record carries straight
over, because the data format is identical.

== Frequently Asked Questions ==

= I already use Giveaway for WooCommerce. Do I lose my data? =

No. Deactivate the old plugin, activate this one. Products, tickets, winners, instant-win
rules, prize groups and settings are stored under the same keys and are picked up as-is.

= Will my existing competitions still say "Giveaway" anywhere? =

The upstream plugin saved its own wording into your options table - labels, on-page
messages and email subjects and bodies. Those saved strings survive the switch, so on
first activation this plugin rewords them for you. It only touches settings you never
edited; anything you customised yourself is left exactly as you wrote it, and listed in
a notice so you can decide. The My Account dashboard URL is also left alone, because
changing it would break existing links.

= Do my theme template overrides still work? =

Yes. Overrides in `yourtheme/compkit-ticket-machine/` take priority, and anything still sitting
in `yourtheme/lottery-for-woocommerce/` is used as a fallback.

= I use Spending Limits for WooCommerce. Do I need it as well? =

No. Ticket Machine reads the same customer data, so switch spending limits on under
Ticket Machine > Spending limits and deactivate the other plugin. Every limit and break
carries over.

= Do the CompKit game modules need changing? =

No. They hook the same functions, filters, meta keys and product tab, and they detect this
plugin automatically.

== Screenshots ==

1. The dashboard - live competitions, tickets sold, what needs your attention and every competition at a glance.
2. Switching from Flintop's Giveaway plugin or WPGenie's WooCommerce Lottery - your competitions, tickets and winners come with you.
3. The setup wizard makes your first competition in a few fields.
4. The competition editor, split into clear tabs: when it runs, tickets, price, ticket numbers, winners and display.
5. Every setting in one searchable screen.
6. A competition on the shop, with a live countdown and ticket picker.
7. Instant win prizes, with how many of each are left.
8. Entry lists, so customers can check every ticket that has been sold.
9. Site credit at checkout - customers spend their instant win credit and pay the rest.
10. Customers see their credit, its history and can ask to withdraw it from My Account.
11. Withdrawal requests: pay them your way, then mark them paid or reject them.
12. Spending limits and breaks, with a full activity log.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
