=== Baxtersweb Credit Packs – Prepaid Credits for WooCommerce ===
Contributors: baxterjones
Tags: woocommerce credits, credit packs, prepaid credits, credit wallet, service credits
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell prepaid credit packs for WooCommerce and let customers redeem credits on selected products while keeping normal payment available.

== Description ==

Baxtersweb Credit Packs adds a focused prepaid credit system to WooCommerce.

Use your existing WooCommerce products to sell packs that grant credits, then choose which products customers can redeem with those credits. No custom WooCommerce product type is required, and eligible products can still be purchased at their normal price.

It works well for lessons, consultations, classes, sessions, services, passes, rentals, downloads, and other businesses that sell prepaid packages. It is designed around purchased credits rather than loyalty points or general-purpose store credit.

= Key features =

* Configure existing WooCommerce products as credit packs or redeemable products without introducing a custom product type.
* Grant a defined number of credits when a Credit Pack product is purchased.
* Set how many credits an eligible product requires.
* Let customers use credits or pay the normal WooCommerce price.
* Recommend available Credit Packs when a customer does not have enough credits.
* Show automatic "Save X%" labels when Credit Packs use normal WooCommerce sale pricing.
* Set optional expiry periods so unused granted credits can expire automatically.
* Manage product credit settings centrally without opening products one by one.
* Give customers a clear balance, available packs, recorded expiry information, and recent credit activity.
* Search and filter the credit ledger by customer, entry type, order, product, and notes.
* Manually add or subtract customer credits from the WordPress admin.
* Rename credits as lessons, sessions, hours, passes, tokens, or your preferred wording.
* Customise frontend messages, icons, colours, spacing, and card styling.
* Display customer balances and product credit information with shortcodes.
* Handle full refunds and cancellations with credit reversals, while flagging ambiguous cases for manual review.
* Add an optional Tutor LMS dashboard summary when Tutor LMS is active.
* Translation ready using the `baxtersweb-credit-packs` text domain.

== Requirements ==

* WooCommerce

Tutor LMS is supported as an optional integration. It is not required for the core credit-pack system.

== Installation ==

1. Install the plugin zip from Plugins > Add New > Upload Plugin.
2. Activate Baxtersweb Credit Packs.
3. Confirm that WooCommerce is installed and active.
4. Open Credit Packs in the WordPress admin.
5. Configure your products, labels, display settings, and messages.
6. Test a Credit Pack purchase and credit redemption before enabling the system for customers.

== Documentation ==

Full setup and usage documentation:

[View the documentation](https://docs.baxtersweb.com/credit-packs)

== Shortcodes ==

Use `[bxtr_credit_packs]` to display the logged-in customer's credit summary card.

Use `[bxtr_credit_packs type="balance"]` to display the current balance only.

Use `[bxtr_credit_packs type="product" product_id="123"]` to display the credit information for a specific WooCommerce product.

Advanced Views product layout example:

`[bxtr_credit_packs type="product" product_id="{{ _layout.object_id }}"]`

Replace `_layout.object_id` with your ACF field name where required by your layout.

== Frequently Asked Questions ==

= Do I need to create special WooCommerce products? =

No. Credit Packs uses your existing WooCommerce products. A product can remain standard, grant credits as a Credit Pack, or be configured as redeemable for credits.

= Can customers still pay normally? =

Yes. Redeemable products can offer credit redemption while retaining their normal WooCommerce price and purchase flow.

= What happens if a customer does not have enough credits? =

The product display can recommend available Credit Packs. If a pack uses WooCommerce sale pricing, the plugin can also show the calculated percentage saving.

= Can credits expire? =

Yes. Credit Packs can have an optional expiry period. Unused granted credits become unavailable when their configured expiry date is reached.

= Is this a wallet or loyalty-points plugin? =

It is a prepaid credit system. Customers purchase packs and redeem those credits against eligible WooCommerce products. It is not designed as a points-for-purchases loyalty programme or a general store-credit replacement.

= Can I rename Credits? =

Yes. You can use labels such as Lessons, Sessions, Hours, Passes, Tokens, or your own wording.

= Does the plugin require Tutor LMS? =

No. WooCommerce is the only required plugin. Tutor LMS support is optional.

= Is the plugin translation ready? =

Yes. User-facing translatable strings use the `baxtersweb-credit-packs` text domain and can be translated using standard WordPress translation tools.

= Do customers need an account? =

A customer account is required when purchasing Credit Packs because the credits need to be attached to a persistent customer balance. Normal guest checkout can remain available for other WooCommerce products.

= What happens when an order is refunded or cancelled? =

Full refunds and cancellations can reverse the relevant credit activity and record the change in the ledger and WooCommerce order notes. Situations that cannot be reversed safely, such as some partial refunds or already-spent pack credits, are flagged for admin review instead of forcing an incorrect balance.

= Does the plugin load an external icon library? =

No. It includes built-in SVG icons and also supports custom theme icon classes. When using a theme icon class, the active theme or another library must provide that icon.

== Changelog ==

= 1.0.1 =
* Fixed credit ledger entries not being recorded reliably after purchases.
* Added ledger repair by WooCommerce Order ID for historical orders with missing entries.
* Added automatic credit expiry based on configured expiry dates.
* Improved credit granting for paid online orders and manual payment methods.
* Added account creation requirements when purchasing Credit Pack products.
* Added Credit Packs information for logged-out visitors on redeemable product pages.
* Added Credit Packs admin submenu navigation.
* Improved admin guidance and shortcode documentation.

= 1.0.0 =
* Initial production release of Baxtersweb Credit Packs.
* Added Credit Pack products, redeemable products, customer balances, and checkout redemption.
* Added customer credit adjustments and a detailed credit ledger.
* Added optional credit expiry, refund handling, cancellation reversals, and order notes.
* Added configurable labels, frontend messages, icons, colours, spacing, and card styling.
* Added central product credit management and shortcode support.
* Added optional Tutor LMS dashboard integration.
