=== Tile Coverage Calculator for WooCommerce ===
Contributors: Tetteris Michalis
Tags: tile, coverage calculator, woocommerce, tiles, flooring
Requires at least: 4.7
Tested up to: 7.0
Stable tag: 1.7.0
Requires PHP: 7.4
WC requires at least: 5.0
WC tested up to: 10.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Tile Coverage Calculator is a WooCommerce plugin that lets customers enter their desired floor area and instantly calculates the boxes needed, total coverage, and price.

== Description ==

Tile Coverage Calculator for WooCommerce adds a per-product coverage area field in the admin. On the product page, customers type in the area they want to cover and the plugin calculates:

* Number of boxes needed (rounded up)
* Total area covered by those boxes
* Total price

All calculations happen client-side — no page reload. The calculator labels, measurement unit, and price suffix are fully configurable from the admin settings page under **ttrp.gr Plugins → Tile Coverage Calculator**.

**Features**

* Per-product coverage area field (simple products)
* Client-side area → boxes → price calculator
* Configurable labels, measurement unit, and section heading
* Category-based visibility — restrict the calculator to specific product categories
* Appearance settings — colours, corner radius, icons, surplus line, optional waste (+%) button
* Price suffix (e.g. /box) appended after WooCommerce price
* Multilingual ready (text domain: `tile-coverage-calculator`)
* HPOS (High-Performance Order Storage) compatible

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate through **Plugins > Installed Plugins**.
3. Go to **ttrp.gr Plugins → Tile Coverage Calculator** to configure labels and units.
4. Edit any simple product and set the **Coverage** field (area per box in your chosen unit).

== Frequently Asked Questions ==

= Which product types are supported? =

Simple products only. The coverage field is hidden for variable and other product types.

= How do I translate the plugin? =

The plugin ships with a Greek translation and a `.pot` source template in the `languages/` folder. To add your own language, place `.po`/`.mo` files named `tile-coverage-calculator-{locale}.mo` in the same folder, or use a plugin like Loco Translate. WPML and Polylang users can translate the configurable front-end labels directly from their string-translation screens.

= Is HPOS supported? =

Yes. Since v1.5.0 the plugin declares compatibility with WooCommerce High-Performance Order Storage (HPOS / custom_order_tables).

== Screenshots ==

1. Calculator displayed on the product page.
2. Admin settings page with labels and unit configuration.
3. Coverage field on the WooCommerce product edit screen.

== Changelog ==

= 1.7.0 =
* New "All Plugins" page under ttrp.gr Plugins: install and activate other ttrp.gr plugins from the dashboard.
* Updates now come through the shared ttrp-common library (replaces update-checker.php).

= 1.6.1 =
* Plugin icon now shows in Dashboard → Updates (update checker passes icons/banners from the update server).

= 1.6.0 =
* Redesigned calculator: highlighted total, bordered area input, optional icons, surplus line.
* New Appearance settings: background/highlight/text colours, corner radius, icons, surplus, and an optional waste button. Empty colours follow your theme.
* Calculator shows results immediately on page load and prompts the customer to enter an area when the field is empty.
* Fixed: front-end calculator heading is now translated (Greek: "Υπολογισμός Πλακιδίων").
* Fixed: box count suffix is now singular/plural and translatable.
* Fixed: area and price use the store's decimal/thousand separators and currency position.

= 1.5.11 =
* Multilingual: default option labels now use __() so fresh installs on non-English sites get translated defaults.
* Multilingual: added WPML and Polylang string registration for all configurable front-end labels (calculator heading, coverage label, area/boxes/cost labels). Strings auto-register on init and after each settings save.
* Multilingual: front-end and price suffix now use tcc_get_display_options() so registered string translations are applied at render time.
* Added Greek (el) translation — all UI strings translated; plugin title kept in English.
* Fixed: coverage field (Coverage per box input) in the product edit screen is now hidden for products outside the configured enabled categories.
* Fixed: currency symbol in the total cost row displayed as HTML entity (e.g. &euro;) — now decoded to the actual character before passing to JavaScript.

= 1.5.10 =
* Category selection on the settings page now uses WooCommerce's Select2-powered wc-enhanced-select, matching the UI of other ttrp.gr plugins.

= 1.5.9 =
* Added category-based visibility — restrict the calculator to selected product categories; leaving nothing selected preserves the existing behaviour (show for all products with a coverage value set).
* Added configurable section heading displayed above the calculator on the product page (default: "Tile Coverage Calculator").
* Admin product field: label and tooltip now read the unit from plugin settings instead of hardcoded Greek text.
* Admin product field: added a bold "Tile Coverage Calculator" heading above the coverage input in the General tab.

= 1.5.8 =
* Bumped Requires PHP from 7.0 to 7.4 (typed properties in update-checker require 7.4+).
* Synced readme.txt tested-up-to values with plugin header (WP 6.9.4, WC 10.7.0).
* Added client-side input validation to the calculator field.
* Removed redundant parseFloat().toFixed(2) chain in calculator display.
* Fixed indentation inside the main if block in the plugin entry point.

For the full changelog see the [GitHub releases page](https://github.com/tetterip/woo-tet-tile-coverage-calculator-sqmt/releases).

== Upgrade Notice ==

= 1.7.0 =
Adds the ttrp.gr Plugins → All Plugins page. No settings changes.

= 1.6.1 =
Maintenance release: plugin icon support in the WordPress updates screen. No settings changes.

= 1.6.0 =
Redesigned calculator with new Appearance settings (colours, icons, surplus, waste button). Existing settings are kept; new options default to theme colours. No database migration.

= 1.5.11 =
Completes multilingual support: WPML/Polylang label registration, Greek translation, admin field category filter, and currency symbol fix. No database changes.
