=== Tikreda – Class Credits for WooCommerce ===
Contributors: goktugzafer
Tags: credits, class pack, sessions, prepaid, woocommerce
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell class packs and session credits. Customers spend them on any class, lesson or service you choose.

== Description ==

Tikreda lets studios, tutors and coaches sell prepaid packs like "10 classes" with WooCommerce. Customers then pay for any eligible class or session with their credits.

**Flexible credits.** A credit type, for example "Group class", can be spent on as many products as you like. One pack covers yoga, pilates and every other class on your timetable.

**A ledger you can trust.** Every change to a balance is stored as its own entry with the running balance. An order can never add or spend credits twice, even if a status changes several times.

**Refunds that add up.** Cancel or refund a class order and the credits come back. Refund a pack, fully or line by line, and its credits are removed.

**Front-desk friendly.** Shop managers can search for any customer and add or remove credits with a note, for example for a cash sale at reception.

**Clean checkout.** When the whole cart is paid with credits, address fields are hidden and the order is recorded at 0, so revenue is not counted twice.

= Features =

* Any number of credit types (Group class, Private lesson, Hours…)
* Credit packs: any WooCommerce product can give credits
* Pay with credits: any product can cost N credits of a type
* "Pay with my credits" payment method for classic and block checkout
* My Account → Credits page with balances and history
* `[tikreda_balance]` shortcode
* Admin screen under WooCommerce → Tikreda
* Compatible with High-Performance Order Storage (HPOS)

== Installation ==

1. Install and activate WooCommerce.
2. Install and activate Tikreda.
3. Go to WooCommerce → Tikreda → Credit types and name your credit types.
4. Edit a product. Under Product data → General → Tikreda, either make it a pack ("Buying this gives") or make it payable with credits ("Can be paid with").
5. Make sure "Tikreda" is enabled under WooCommerce → Settings → Payments.

== Frequently Asked Questions ==

= Can customers check out as guests? =

Credits belong to a customer account, so packs bought as a guest do not add credits. The order gets a note so you can assign it and add the credits manually.

= Can a cart mix credit-paid and money-paid items? =

Not yet. A cart is paid either fully with credits or fully with money. Carts that need shipping are always paid with money.

= What happens if a pack is refunded after some credits were used? =

The credits are removed anyway and the balance can go below zero. You can see this in the customer's history and fix it with a manual adjustment.

= Is my data deleted when I remove the plugin? =

No. Credit balances are your customers' prepaid value, so they are kept unless you set the `flxc_delete_data_on_uninstall` option to `yes` before deleting the plugin.

= Where is the source of the admin screen? =

The compiled file in `build/` is generated from `src/` with `@wordpress/scripts`. Run `npm install` and `npm run build` in the plugin folder to rebuild it.

== Screenshots ==

1. Every customer's credit balances at a glance (WooCommerce → Tikreda).
2. A customer's full history, with a form to add or remove credits for front-desk sales and corrections.
3. Credit types: one type can be spent on as many classes or services as you like.
4. Product settings: make a product a credit pack, or let customers pay for it with credits.
5. Checkout: "Pay with my credits" shows what the order costs and what the customer has. Address fields are hidden for credit-only carts.
6. My Account → Credits: balances and a clear history for the customer.

== Changelog ==

= 0.1.0 =
* First release.
