=== WooText Change ===
Contributors: progremzion
Donate link: https://tyralix.com/
Tags: woocommerce, out of stock, stock status, availability text, find and replace
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.5.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Customize WooCommerce stock and availability text for every status — per product, per category, with merge tags and a find-and-replace engine.

== Description ==

Progremzion WooText Change lets you rewrite WooCommerce stock and availability
text without touching a template. Start with "Out of stock" → "Sold", then
customise every stock state, per product or per category, and replace any other
WooCommerce string across your whole store.

**Stock status text**

* Set your own text for **In stock**, **Low stock**, **Out of stock** and
  **On backorder / Available on backorder**.
* Language-independent: it matches the product's stock *status*, not the English
  string, so it works on translated stores too.

**Low-stock urgency**

* Show a "Selling fast — only 3 left!" style message when stock drops to a
  threshold you choose (or WooCommerce's own low-stock amount).
* Toggle whether the real quantity is shown or hidden.

**Merge tags**

* Use `{stock_qty}`, `{product_name}` and `{sku}` inside any of your text.

**Per-product & per-category overrides**

* Override the text for a single product (Inventory tab) or a whole product
  category. Product beats category beats the global setting.

**Find-and-replace anywhere**

* Add unlimited find-and-replace rules to change *any* WooCommerce string —
  shop, cart, checkout, mini-cart, emails and order details — with optional
  case-sensitive matching.

**Styling & display**

* Turn the availability text into a coloured **pill/badge** (text colour,
  background, corner radius, weight, uppercase) with a **live preview**.
* Add an **icon/emoji** before each stock status.
* Show **badges/ribbons on product images** ("SOLD", "Coming soon", "Last one")
  on the shop grid and product page, positioned top-left or top-right.
* When a product is out of stock, **hide the Add to cart button** or **replace it**
  with custom text or a button linking anywhere (e.g. a waitlist page).

**Back-in-stock waitlist**

* Show a "notify me" email form on out-of-stock products, store subscribers, and
  **email them automatically when the product is restocked**. View/export
  subscribers from the admin.

**Merchandising, pre-orders & urgency**

* Set an **expected restock date** per product and show it with `{restock_date}` or
  a live countdown with `{restock_countdown}` ("in 3 days").
* **Pre-order** mode: flag a product, relabel its button, and show a pre-order
  message + badge.
* **Urgency / social proof** line using real sales data (`{total_sales}`).
* **Sort out-of-stock products to the end** of shop/category pages, or hide them.

**Admin tools**

* A first-run **setup wizard**, import / export all settings as JSON, reset to
  defaults, and a **no-conflict mode** that disables the plugin's own CSS.

**Translation-ready**

* Fully translatable (includes a .pot template and bundled Spanish, French and
  German translations), and every configurable string is registered for **WPML**
  and **Polylang** String Translation.

This plugin requires WooCommerce to be installed and active. It is compatible
with WooCommerce High-Performance Order Storage (HPOS) and Cart/Checkout Blocks,
and adds badges to the new product blocks. Availability labels and badges include
accessibility markup (decorative icons are hidden from screen readers).

== Installation ==

= From your WordPress dashboard =

1. Go to Plugins > Add New.
2. Search for "Progremzion WooText Change".
3. Click Install Now, then Activate.

= From WordPress.org =

1. Download the plugin ZIP.
2. Upload the `progremzion-wootext-change` directory to `/wp-content/plugins/`.
3. Activate the plugin from your Plugins page.

Then open **WooCommerce > WooText Change** to configure it.

== Frequently Asked Questions ==

= Where do I configure it? =

Go to **WooCommerce > WooText Change**. You can also set overrides on a single
product (Inventory tab) or on a product category.

= Does it work on non-English stores? =

Yes. Stock status text is matched by stock *status*, not the displayed English
words, and every string is registered for WPML and Polylang.

= What merge tags are available? =

`{stock_qty}`, `{product_name}` and `{sku}`. Untick "Show quantity" to hide the
number (for example, show "Low stock" instead of "Only 3 left").

= Can I change text on the cart or checkout, not just the product page? =

Yes. Use the **Find & replace rules** to change any WooCommerce text wherever it
appears — cart, checkout, mini-cart, emails and order details included.

= Which text wins if I set it in more than one place? =

Per-product override, then per-category override, then the global setting.

== Screenshots ==

1. The tabbed settings screen under WooCommerce > WooText Change.
2. "Out of stock" replaced with your custom text on the product page.
3. Product-image badges and the back-in-stock waitlist on the storefront.

== Privacy ==

The back-in-stock waitlist feature (off by default) stores the email address a
visitor submits, together with the product ID and the date, in a dedicated
database table. This data is used only to send that visitor the restock
notification they requested. It is not shared with any third party, and no data
is sent anywhere outside your site. Administrators can view, export (CSV) and
delete subscribers from WooCommerce &gt; WooText Waitlist. If you enable this
feature, mention the email collection in your site's own privacy policy.

== Changelog ==

= 2.5.0 =
* New: the settings screen is now organised into tabs (Stock text, Styling & badges, Conversion, Find & replace, Tools).
* New: find-and-replace rules can optionally also apply to page and product descriptions and page-builder content (Elementor, Gutenberg blocks, shortcodes).
* New: delete individual waitlist subscribers from the admin.
* Improved: clearer "Icon" help (type any emoji) and full-word colour labels on badges.
* Added a Privacy section to the readme covering waitlist email storage.

= 2.4.0 =
* New: live restock countdown merge tag {restock_countdown} ("in 3 days").
* New: pre-order mode — flag a product, relabel its button, show a pre-order message + badge.
* New: urgency / social-proof line using real sales data ({total_sales}).
* New: first-run setup wizard.
* New: no-conflict mode to disable the plugin's CSS.
* New: badges now render on the new WooCommerce product blocks.
* New: bundled Spanish, French and German translations.
* Improved: accessibility markup on labels and badges.

= 2.3.0 =
* New: back-in-stock waitlist — email capture on out-of-stock products with automatic restock notifications, plus an admin subscriber list and CSV export.
* New: expected restock date per product and the {restock_date} merge tag.
* New: sort out-of-stock products last, or hide them from the catalog.
* New: import / export settings as JSON and reset to defaults.
* New: first-run onboarding notice.
* New: declared WooCommerce Cart/Checkout Blocks compatibility; added a .pot translation template.

= 2.2.0 =
* New: availability label pill styling (colours, radius, weight, uppercase) with live preview.
* New: icon/emoji before each stock status.
* New: product-image badges/ribbons per state on the shop grid and product page.
* New: hide or replace the Add to cart button (with optional link) when out of stock.
* Improved: shared stock-state detection; new styling strings registered for WPML/Polylang.

= 2.1.0 =
* New: custom text for every stock status — In stock, Low stock, Out of stock, On backorder.
* New: per-product and per-category text overrides.
* New: low-stock threshold with "Selling fast!" style messaging and a show/hide quantity toggle.
* New: merge tags {stock_qty}, {product_name}, {sku}.
* New: find-and-replace rules engine that works on shop, cart, checkout, mini-cart, emails and order details.
* New: WPML and Polylang string-translation support.
* New: declared WooCommerce HPOS compatibility.
* Settings moved to WooCommerce > WooText Change; existing settings migrate automatically.

= 2.0.0 =
* New: settings page to set the replacement text.
* New: language-independent matching by stock status.
* Added direct-access protection and translation support.
* Declared the WooCommerce dependency via `Requires Plugins`.
* Added plugin icon, banner, and screenshots.
* Updated tested-up-to and minimum PHP/WordPress versions.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.5.0 =
Tabbed settings, find-and-replace for page-builder content, and waitlist subscriber deletion. Your existing settings are kept.

= 2.4.0 =
Adds pre-orders, restock countdowns, urgency labels, a setup wizard, block badges and bundled translations. Your existing settings are kept.

= 2.3.0 =
Adds a back-in-stock waitlist, restock dates, catalog sorting and settings import/export. Your existing settings are kept.

= 2.2.0 =
Adds visual styling: label pills, product-image badges, status icons, and out-of-stock Add to cart control. Your existing settings are kept.

= 2.1.0 =
Big update: customise every stock status, per-product/category overrides, merge tags, and store-wide find-and-replace. Your existing text is kept. Back up before updating.
