=== TierStep Pricing for WooCommerce ===
Contributors: commercewp26
Tags: woocommerce, pricing, dynamic pricing, discounts, ecommerce
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Raise a WooCommerce product's price automatically as cumulative units sold cross thresholds you define, with optional campaign dates.

== Description ==

TierStep Pricing for WooCommerce lets a merchant define cumulative-units-sold pricing tiers on a simple product: for example, the first 50 units sold at $19, the next 100 at $29, then the regular price for everything after that. The price changes automatically as real sales happen - no manual price edits, no coupon codes.

This is a free plugin with no paid tier and no artificially restricted functionality.

**Core features (V1)**

* Up to three cumulative-sold-units pricing tiers per product.
* An optional campaign start date and end date, checked independently of the tier thresholds (whichever condition ends the campaign first wins).
* A per-campaign "Allow coupons during this campaign" toggle, so a merchant can choose whether coupons may discount a tier price further - independent of each coupon's own "Exclude sale items" setting.
* Pausing a campaign (unchecking "Enable") does not reset its progress. Re-enabling it resumes counting from where it left off rather than starting a new campaign from zero.
* A single order cannot cross a tier boundary and get its entire quantity priced at the cheaper tier - the quantity a customer can add is capped to whatever remains in the currently active tier, enforced on both classic WooCommerce checkout and WooCommerce Blocks/Store API checkout.
* If someone else's order consumes the remaining tier allocation while a different customer already has units sitting in their cart, that customer is shown a clear error (on both classic Cart/Checkout pages and Blocks-based ones) instead of silently completing a purchase at a price that's no longer valid.
* Compatible with WooCommerce High-Performance Order Storage (HPOS).

**Current scope (V1)**

* Simple products only. Variable, Grouped, and External/Affiliate products are not supported in this version - the "TierStep Pricing" tab is hidden for them, and nothing about their pricing is affected.
* "Units sold" is tracked using WooCommerce's own built-in sales counter. Refunds do not reduce the count (only an explicit order cancellation does) - a refunded sale still counted toward the tier at the time it happened.

== Installation ==

1. Make sure WooCommerce is installed and active - this plugin does nothing without it.
2. Upload the plugin files to the `/wp-content/plugins/tierstep-pricing-for-woocommerce` directory, or install the plugin through the WordPress plugins screen directly.
3. Activate the plugin through the "Plugins" screen in WordPress.
4. Edit a simple product, open the "TierStep Pricing" tab in the Product data box, check "Enable TierStep pricing campaign", fill in one or more tiers (cumulative units sold / price), and optionally a start and/or end date.
5. Save/update the product.

== Frequently Asked Questions ==

= Does this work with variable, grouped, or external/affiliate products? =

Not in this version. The "TierStep Pricing" tab only appears for simple products. This is a deliberate scope decision for the first release, not a bug.

= What happens if a customer already has units in their cart and someone else buys the remaining tier allocation first? =

The customer sees a clear error message the next time their cart or checkout page is checked (on both classic WooCommerce pages and WooCommerce Blocks/Store API pages), telling them how many units are actually still available at the campaign price. Nothing is silently charged at a price that's no longer valid.

= Does pausing a campaign (unchecking "Enable") reset my pricing tiers back to the start? =

No. The very first time a campaign is enabled, the plugin records how many units had already sold before that point. Unchecking "Enable" only pauses price changes - it does not erase that starting point. Re-enabling the campaign later resumes counting from the same baseline, not a new one.

One thing to know: because this plugin counts units using WooCommerce's own total-sales tracking (rather than a separate counter), any sales that happen while the campaign is paused still count toward the tier allocation once you turn it back on.

= Will coupons still work on a product with an active tier price? =

Yes, by default. Each campaign also has its own "Allow coupons during this campaign" setting - uncheck it if you want to make sure no coupon of any kind can discount the tier price further, regardless of that coupon's own settings.

= Does this work with WooCommerce Blocks (the Cart and Checkout blocks) as well as classic checkout? =

Yes. Pricing, quantity limits, and cart/checkout error messages are all verified against both classic WooCommerce templates and the block-based Cart/Checkout/Store API.

= Is this compatible with High-Performance Order Storage (HPOS)? =

Yes. The plugin declares compatibility and never reads or writes order data directly - it only reads a product's own built-in sales count through WooCommerce's standard product API.

= Is there a Pro version with more tiers or more features? =

No. This plugin is free, with no paid tier, no feature gating, and no artificial limits beyond what's documented here.

== Screenshots ==

1. The "TierStep Pricing" tab on a simple product's edit screen, showing the enable toggle, tier table, and optional campaign dates.

== Changelog ==

= 1.0.0 =
* Initial public release. Cumulative-units-sold pricing tiers for simple products, optional campaign start/end dates, per-campaign coupon-interaction control, pause/resume without losing progress, and full HPOS + WooCommerce Blocks (Cart/Checkout) compatibility.

== Upgrade Notice ==

= 1.0.0 =
Initial public release.
