=== Joinery Core ===
Contributors: joinery
Tags: woocommerce, discount rules, dynamic pricing, cart discount, role based pricing
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Discount rules for WooCommerce, and the shared core that lets Joinery plugins work together.

== Description ==

Joinery Core gives your store a simple rule builder: choose when a rule applies (customer role, cart quantity, cart subtotal, product category, dates) and what it does (percentage off items or off the cart).

It is also the foundation for the paid Joinery plugins. They all use the same rules engine, pricing pipeline and customer wallet, so they work together without conflicts.

= Works without code, and headless =

Rules run on the server inside WooCommerce, so prices are right in the classic and block cart and checkout, and in the Store API for headless stores. Developers get a price-preview REST endpoint and can add their own conditions and actions with two PHP functions.

= Privacy =

Joinery Core doesn't contact any external service and doesn't track you or your customers. Pricing rules run on your own server. If you use store credit (added by paid Joinery plugins), each credit and use of credit is stored in your database and works with WordPress's personal data export and erasure tools.

= Source code =

The admin screen's JavaScript in `build/` is compiled. Its readable source ships with the plugin in `assets/` (including the shared packages in `assets/packages/`). To rebuild it, run `npm install` and `npm run build` in the plugin folder; it uses @wordpress/scripts.

== Installation ==

1. Install and activate WooCommerce.
2. Install and activate Joinery Core.
3. Go to Joinery → Rules and add your first rule.

== Frequently Asked Questions ==

= Does it work with the block cart and checkout? =

Yes. Rules apply wherever WooCommerce calculates the cart: classic and block cart, checkout, and the Store API.

= Do I need a paid plugin? =

No. Joinery Core works on its own. Paid Joinery plugins add more rule types, such as tiered pricing, wholesale accounts and gift cards, to the same rules screen. A small “More rule types” panel there lists the ones you don’t have; you can hide it.

= Does it slow down my store? =

Active rules are loaded with one database query per request, and each price is worked out in a single pass through them.

= Can developers extend it? =

Yes. Register conditions and actions on the `joinery_core_init` hook. See the developer documentation.

== Screenshots ==

1. Joinery → Rules: every rule in one list, with the selected rule open beside it.
2. A cart rule: 5% off the whole order once the cart subtotal reaches $100.
3. A date condition limits a rule to a sale weekend. Rules can be saved switched off until you need them.
4. The block cart with both rules applied: 10% off each hardware item, then 5% off the order.

== Changelog ==

= 0.4.0 =
* New: A small “More rule types” panel on Joinery → Rules lists the paid Joinery plugins that add rule types. It only shows plugins you don’t have, and you can hide it.

= 0.3.0 =
* New: Rules can tell whether the customer has ordered before, for first-order offers.

= 0.2.0 =
* New: Event actions, rules that run once an order is paid or completed.
* New: Store credit spends the credit that expires soonest first.
* Fix: Lines kept out of pricing no longer count toward cart conditions and discounts.

= 0.1.0 =
* First development version.
