=== Simple Tiered Pricing Table for WooCommerce ===
Contributors: anhqui
Tags: woocommerce, tiered pricing, quantity discount, bulk discount, wholesale, volume discount, dynamic pricing, price by quantity, discount table, b2b
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
WC requires at least: 6.0
WC tested up to: 11.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce tiered pricing & quantity discount plugin: bulk pricing tables, wholesale discounts, live updates, "You Save" labels.

== Description ==

**Simple Tiered Pricing Table for WooCommerce** is the easiest way to add tiered pricing, quantity discounts, and volume price breaks to your WooCommerce store. Customers instantly see how much they save when buying more — no coding required.

Set a lower unit price for larger quantities, show a clean pricing table on the product page, and watch the price update live as customers change the quantity.

= Free vs Pro at a glance =

**Free** — fixed-price quantity tiers (unlimited tiers and products), 5 display templates (Table, Blocks, List, Tooltip, Dropdown), live price updates, "You Save" labels, minimum/maximum/step quantity controls, shop-page price ranges, colours and labels, shortcode, REST API, CSV import/export.

**Pro** adds — percentage discounts, different tiers per variation, role-based pricing, global pricing rules with Mix & Match, cart upsell messages, and role-based pricing in CSV import/export.

👉 [Get TierMatrix Pro](https://checkout.freemius.com/plugin/32976/plan/54210/)

= Free Features =

**Quantity-Based Tiered Pricing**

* Set a fixed unit price per quantity tier (e.g. 1–4: $10, 5–9: $9, 10+: $8)
* Unlimited pricing tiers on unlimited products
* Live price updates as the customer changes quantity
* "You Save" labels and a "Selected Tier / Your Price" summary
* Simple and Variable products — the table updates when a variation is selected (all variations share the product's tiers)
* Works alongside WooCommerce coupons and taxes

**5 Pricing Table Display Templates**

* **Table** — classic column layout (Quantity | Discount | Price)
* **Blocks** — card-style grid
* **List** — minimal bullet layout
* **Tooltip** — hover icon keeps the page clean
* **Dropdown** — compact select, ideal for mobile
* Set a default template, or choose one per shortcode
* Choose where it appears: before/after Add to Cart, before/after product meta, or after the summary
* Show or hide the discount column
* Optionally hide the table from logged-out visitors

**Quantity Controls**

* Minimum order quantity per product
* Maximum order quantity per product
* Quantity step — sell in packs of 6, 12, 24…

**Shop & Category Page Price Display**

* Price range ("$75.00 – $100.00")
* Lowest price ("From $10.00")
* "As low as $X.XX"
* Custom prefix text

**Colours & Labels**

* Highlight colour, highlight text colour, header background and header text
* Rename the Quantity, Discount and Price columns, the summary labels, and unit names (e.g. "box / boxes")

**Developer Tools**

* Shortcode `[tiered-pricing-table]` — place the table anywhere
* WooCommerce REST API — read and write tiered pricing via `/wp-json/wc/v3/products/{id}`
* CSV import/export of tiers and quantity controls via WooCommerce's built-in product CSV tools
* Built-in transient cache
* HPOS (Custom Order Tables) compatible
* Classic and block-based Cart & Checkout supported

= Pro Features =

**[PRO] Percentage Discounts**
Give 10% off at 10+ units, 15% off at 25+, and so on — on any product or global rule.

**[PRO] Different Tiers per Variation**
Give each variation its own pricing type and tiers — for example, Small T-shirt 5+ = $8 and Large T-shirt 5+ = $10 — instead of one set of tiers for the whole product. The product page table switches when a variation is chosen, and the cart, checkout and shop-page prices follow.

**[PRO] Role-Based Pricing**
Different regular prices, sale prices, tiers and minimum quantities for Wholesale, Retailer, VIP or any custom role. Hide the pricing table for selected roles.

**[PRO] Global Pricing Rules**
Create one rule and apply it to many products and/or categories — or your whole catalogue. Target user roles or specific customers, set priorities, and add per-rule quantity limits.

**[PRO] Mix & Match Quantities**
Let different products count together toward the same tier.

**[PRO] Cart Upsell Messages**
Show "Buy 2 more to save 15%!" in the cart. Customise the message with `{qty_needed}`, `{discount}` and `{next_price}` placeholders.

**[PRO] Role Pricing in CSV**
Export and import role-based prices and tiers with WooCommerce's built-in product CSV tools, alongside the free tier columns.

👉 [Get TierMatrix Pro](https://checkout.freemius.com/plugin/32976/plan/54210/)

= Already using the plugin? =

If your store used percentage discounts before version 1.0.3, you keep them — free, automatically. Nothing changes on your store.

= Upgrading from Free to Pro =

Pro is a separate plugin: deactivate the free plugin, then install and activate Pro. **Pro imports your existing tiers, quantity controls and settings automatically**, so your store keeps working without any setup. Your free-version data stays saved in case you ever switch back.

= Enjoying This Plugin? =

If Simple Tiered Pricing Table has helped you set up quantity discounts and bulk pricing on your store, please take a moment to [leave a ★★★★★ review](https://wordpress.org/support/plugin/anhqui-tiermatrix-for-woocommerce/reviews/?rate=5#new-post). Your review helps other WooCommerce store owners discover the plugin and directly supports its continued development. Thank you!

= Shortcode Usage =

`[tiered-pricing-table product_id="123"]`

The prefixed alias `[anhqtm-pricing-table]` also works.

Choose a template per placement:
`[tiered-pricing-table product_id="123" template="blocks"]` — `table`, `blocks`, `list`, `tooltip`, `dropdown`

= REST API =

The plugin extends the WooCommerce Products REST endpoint with a `tiered_pricing` field.

**Read pricing data:**

`GET /wp-json/wc/v3/products/123`

Returns:

```json
{
  "tiered_pricing": {
    "pricing_type": "fixed",
    "tiers": [
      { "qty": 5,  "value": 9.00 },
      { "qty": 10, "value": 8.00 }
    ],
    "min_qty": 1,
    "max_qty": 0,
    "qty_step": 0
  }
}
```

`"pricing_type": "percentage"` requires Pro.

**Write pricing data** (requires authentication):

`POST /wp-json/wc/v3/products/123`

Send the same `tiered_pricing` object in the request body.

The field `anhqtm_tiered_pricing` is also available as a prefixed alias for backward compatibility.

Per-variation tiers via `/products/{id}/variations/{vid}` require Pro.

== Installation ==

1. Upload the `anhqui-tiermatrix-for-woocommerce` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **WooCommerce → Tiered Pricing** to configure global settings.
4. Open any product and switch to the **Tiered Pricing** tab inside the product data box.

== Frequently Asked Questions ==

= What is the difference between Free and Pro? =

Free gives you fixed-price quantity tiers on unlimited products, all 5 display templates (Table, Blocks, List, Tooltip, Dropdown), live price updates, quantity controls, shop-page price ranges, colours and labels, the shortcode, the REST API and CSV import/export. Pro adds percentage discounts, different tiers per variation, role-based pricing, global pricing rules with Mix & Match, cart upsell messages, and role-based pricing in CSV import/export.

= Is the free version limited? =

No product or tier limits. Use fixed-price tiers on as many products as you like.

= I used percentage discounts before version 1.0.3. Will I lose them? =

No. Stores that used percentage discounts before 1.0.3 keep them automatically, free of charge. Nothing changes on your store.

= How do I add quantity discounts to a product? =

Open a product, go to **Product data → Tiered Pricing**, add rows such as "5 → $9.00" and "10 → $8.00", and save. The pricing table appears on the product page and the cart charges the tier price automatically.

= Can I give percentage discounts, like 10% off for 10 or more? =

Percentage discounts are a Pro feature. The free version uses fixed unit prices per tier. [Get Pro](https://checkout.freemius.com/plugin/32976/plan/54210/)

= Which display templates are included? =

All five are free: **Table**, **Blocks**, **List**, **Tooltip** and **Dropdown**. Choose a default in **WooCommerce → Tiered Pricing**, or pick one per shortcode with the `template` attribute.

= Can I show different prices to wholesale and retail customers? =

Yes, with **Pro**. Role-based pricing lets you set different prices, sale prices, tiers and minimum quantities per user role, and hide the table for specific roles.

= Can I apply one discount rule to many products or a whole category? =

Yes, with **Pro**. Global pricing rules apply to selected products, categories or your whole store, can target roles or specific customers, and support Mix & Match quantities.

= Can I show "Buy X more to save" messages in the cart? =

Yes, with **Pro**. Cart upsell messages are fully customisable with placeholders.

= Can I import and export tiered pricing via CSV? =

Yes (Free). Export and import the pricing type, tiers and quantity controls with WooCommerce's built-in product CSV tools. Including role-based pricing data in the CSV is a **Pro** feature.

= Does it work with variable products? =

Yes (Free). The tiers on the product's Tiered Pricing tab apply to every variation, and the table updates live when a variation is chosen. With fixed prices, every variation gets the same tier price. To give each variation its own tiers, use Pro (see the next question).

= Can each variation have different tiers? =

Yes, with **Pro**. Tick "Use custom tiered pricing for this variation" in a variation's settings to give it its own pricing type and tiers — for example, Small 5+ = $8 and Large 5+ = $10. The product page table, cart, checkout and shop-page prices all use that variation's tiers. Global rules and role-based pricing still take priority. [Get Pro](https://checkout.freemius.com/plugin/32976/plan/54210/)

= Can I show tiered prices on shop and category pages? =

Yes (Free). Show a price range, "From $X" or "As low as $X" in **WooCommerce → Tiered Pricing**.

= Can I set minimum, maximum or pack quantities? =

Yes (Free). Set them in the **Quantity Controls** section of the product's Tiered Pricing tab.

= Can I place the table with a shortcode, Gutenberg or a page builder? =

Yes (Free). Use `[tiered-pricing-table product_id="123"]` in a Shortcode block, Elementor, Divi, WPBakery or any builder. Add `template="blocks"` (or `list`, `tooltip`, `dropdown`) to choose the layout per placement.

= Does it work with HPOS, coupons, taxes and the block cart? =

Yes. It's HPOS compatible. Coupons and taxes apply to the tier price as normal. Classic and block Cart/Checkout are supported.

= Will this slow down my store? =

No. Computed prices are cached in WordPress transients. Adjust this in **WooCommerce → Tiered Pricing → Performance**.

= How do I upgrade to Pro? =

Buy Pro and download it from your account. Then go to **Plugins**, deactivate the free plugin, upload Pro and activate it. That's it. Your existing setup comes with you (see the next question).

= Will my existing tiers and settings move to Pro? =

Yes. When you activate Pro (version 1.0.2 or later), it automatically imports from the free plugin:

* every product's tiered prices, pricing type, and minimum/maximum/step quantities
* your settings: template, position, colours, labels, shop-page price display and cache

Your shortcodes and REST API integrations keep working too. Nothing is deleted from the free plugin, so you can switch back at any time. You can also re-run the import any time in Pro, from the Import from TierMatrix Free card under WooCommerce → Tiered Pricing.

Note: if you later switch from Pro back to Free, changes you made in Pro are not copied back to the free plugin, and Pro-only features stop working: per-variation tiers, role-based pricing, global rules and cart upsell messages. Percentage discounts also stop working, unless your store used them before version 1.0.3.

= Where can I get support? =

Post in the [support forum](https://wordpress.org/support/plugin/anhqui-tiermatrix-for-woocommerce/) on WordPress.org.

= How can I support this plugin? =

The best way is to [leave a ★★★★★ review](https://wordpress.org/support/plugin/anhqui-tiermatrix-for-woocommerce/reviews/?rate=5#new-post) on WordPress.org. It only takes a minute and helps other store owners find the plugin.

== Screenshots ==

1. Product page pricing table (Table template) with live "You Save" summary
2. Blocks template — card-style grid
3. List template — minimal layout
4. Tooltip template — hover icon keeps the page clean
5. Dropdown template — compact select, great on mobile
6. Tiered Pricing tab: fixed-price tiers and min/max/step quantity controls
7. Shop page tiered price range (or "From" / "As low as" labels)
8. Settings: template, display position, colours, labels and shop-page options
9. Import and export tiers and quantity controls with WooCommerce's CSV tools
10. Pro Features tab — compare Free and Pro, and upgrade in one click
11. [PRO ONLY] Percentage discount tiers — e.g. 10% off at 10+, 15% off at 25+
12. [PRO ONLY] Different tiers per variation — each variation can have its own pricing type and tiers
13. [PRO ONLY] The pricing table switches to the selected variation's own tiers
14. [PRO ONLY] Role-based pricing — different prices, tiers and minimums per user role
15. [PRO ONLY] Global pricing rules across products and categories
16. [PRO ONLY] Global rule editor with Mix & Match, roles and users
17. [PRO ONLY] Cart upsell message — "Buy 2 more to get 15% off!"

== Changelog ==

= 1.0.3 =
* Change: Percentage discounts are now a Pro feature for new installs. Fixed-price tiers, all 5 templates and CSV import/export stay free.
* Existing stores that already used percentage discounts keep them automatically, with no action needed.
* New: "Pro Features" tab showing everything Pro adds.
* Upgrading to Pro 1.0.2+ now carries over your tiers and settings automatically.
* Fix: blank column labels now fall back to the default text instead of showing an empty header.
* Fix: activation no longer overwrites the stored version before upgrade routines run.
* Hardening: REST and settings inputs are validated against allowed values.

= 1.0.2 =
* Confirmed compatibility with WordPress 7.1 and WooCommerce 11.0.1.
* Fixed a WordPress.org listing warning caused by the short description exceeding the 150-character limit.
* Improved plugin listing keywords (tags and short description) for better search visibility.

= 1.0.1 =
* Feature: Shortcode `[tiered-pricing-table]` now matches the Pro plugin's shortcode tag — no changes needed when upgrading. The `[anhqtm-pricing-table]` alias remains supported for backward compatibility.
* Feature: REST API field `tiered_pricing` now matches the Pro plugin's field name — no API changes needed when upgrading. The `anhqtm_tiered_pricing` alias remains supported for backward compatibility.

= 1.0.0 =
* Initial release.
* Quantity-based tiered pricing with percentage discounts or fixed prices per tier.
* Live price update as the customer changes quantity on the product page.
* Five display templates: Table, Blocks, List, Tooltip, Dropdown.
* "You Save" labels on each tier row.
* Customisable highlight colours and column labels via Settings.
* Quantity controls: minimum order quantity, maximum order quantity, quantity step.
* Shop and catalog page price display — lowest price ("From $X") or full range ("$X – $Y").
* Shortcode `[anhqtm-pricing-table]` for manual placement.
* WooCommerce REST API support — read and write tiered pricing via the Products endpoint.
* Basic CSV import/export via WooCommerce's built-in product CSV tools.
* Built-in transient cache for zero performance impact.
* HPOS (Custom Order Tables) compatible.
* Tested up to WordPress 6.8 and WooCommerce 9.8.0.

== Upgrade Notice ==

= 1.0.3 =
Percentage discounts move to Pro for new installs. If your store already uses them, you keep them — nothing changes for you. All 5 templates and CSV import/export stay free.

= 1.0.2 =
Confirmed compatibility with WordPress 7.1 and WooCommerce 11.0.1. Also fixes the truncated short description on the WordPress.org listing.

= 1.0.1 =
Adds `[tiered-pricing-table]` shortcode and `tiered_pricing` REST field — matching the Pro plugin so upgrades require no code changes.

= 1.0.0 =
Initial release.
