=== WooCommerce Punch Cards ===
Contributors: stasarshanski
Tags: woocommerce, punch cards, loyalty, qr code, services
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
WC requires at least: 8.0
WC tested up to: 9.0
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell punch cards for services in WooCommerce. Customers buy cards, present QR codes, and store owners scan to punch.

== Description ==

WooCommerce Punch Cards lets you sell punch-style loyalty cards for services like haircuts, car washes, coffee, massages, or any repeatable service.

**How it works:**

1. You create a Punch Card product (e.g., "10 Haircuts for $80")
2. Customer purchases it through your WooCommerce checkout
3. Customer receives a unique QR code in their My Account area
4. When the customer visits, they show the QR code
5. You scan it with the built-in admin scanner to record a punch
6. When all punches are used, the card is marked as complete

**Key Features:**

* Custom "Punch Card" product type with configurable punch count
* QR code generation (SVG) for each card
* Built-in QR scanner in WordPress admin (uses device camera)
* Manual card lookup by code
* Customer "Punch Cards" tab in My Account with QR display and punch history
* Admin list table with search, filter, status badges, and CSV export
* Email notifications when cards are created, punched, or completed
* Card expiry support with per-product expiry days
* Daily auto-expiry cron job
* Full REST API for card lookup and punching
* HPOS (High-Performance Order Storage) compatible
* Translation-ready with POT file included
* Theme template overrides supported
* Clean uninstall (removes all data)

**Multi-Vendor Support:**

Works with popular multi-vendor plugins out of the box:

* Dokan
* WCFM Marketplace
* WC Vendors

Vendors get their own dashboard pages with card lists and QR scanners, and can only see/punch their own cards.

== Installation ==

1. Upload the `woocommerce-punch-cards` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Make sure WooCommerce is installed and active
4. Go to Products > Add New, select "Punch Card" as the product type
5. Set the price and number of punches
6. Publish and start selling!

== Frequently Asked Questions ==

= How do customers use their punch cards? =

After purchasing, customers can view their punch cards under My Account > Punch Cards. Each card has a unique QR code that they show to the store owner/staff.

= How do I punch a card? =

Go to WooCommerce > Punch Cards > Scanner tab. Click "Start Scanner" to use your camera, or enter a card code manually. You can also punch directly from the card list.

= Can I set cards to expire? =

Yes. When editing a Punch Card product, set the "Expiry (days)" field. Cards will automatically expire after that many days from purchase.

= Can I export punch card data? =

Yes. Go to WooCommerce > Punch Cards and click the "Export CSV" button to download all cards matching your current filters.

= Can I customize the templates? =

Yes. Copy templates from `wp-content/plugins/woocommerce-punch-cards/templates/` to `wp-content/themes/your-theme/woocommerce-punch-cards/` and modify them.

= Does it work with multi-vendor plugins? =

Yes. Dokan, WCFM Marketplace, and WC Vendors are supported. Vendors get their own dashboard for managing and scanning punch cards.

== Changelog ==

= 1.2.0 =
* Added card expiry support with per-product settings
* Added email notifications for card events
* Added CSV export
* Added settings page
* Added template override support
* Added i18n POT file
* Added uninstall.php

= 1.1.0 =
* Added multi-vendor support (Dokan, WCFM, WC Vendors)

= 1.0.0 =
* Initial release
