=== CatCode Size Price Calculator for WooCommerce ===
Contributors: catcodestudio
Tags: price calculator, measurement, area, square meter, custom size
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell by length, area or volume: the customer enters the size, the price is calculated per m, m², m³ or ft². Limits, size lists, minimum area.

== Description ==

Blinds, glass, fabric, flooring, countertops, rods, cables, banners — anything cut to size. The customer enters the size on the product page, sees the price for exactly that size, and the size travels with the order.

The product price becomes the price per unit: set 25 as the price, choose "per m²", and a 120 × 80 cm blind costs 0.96 m² × 25. Variable products work the same way — each variation's price is its price per unit.

**Features**

* Three modes: length (L), area (width × height), volume (width × height × depth).
* Units: the customer enters millimetres, centimetres, metres, inches, feet or yards; the price is per metre, m², m³, foot, ft², yard… — any combination, converted automatically.
* Per dimension: your own label, minimum, maximum and step, or a fixed list of allowed values shown as a drop-down (e.g. lengths 2, 4, 6 … 20 ft).
* Minimum billed measure per piece (a 0.4 m² piece is charged as 1 m²) and rounding of the billed measure up to a step (0.93 m² → 1.0 m²).
* Live price on the product page, recalculated on the server — the price that reaches the cart is always calculated by the store, never taken from the browser.
* The size, the area and the billed area are shown in the cart, mini-cart, checkout, order, e-mails and the admin order screen. The same product in different sizes becomes separate cart lines.
* "Order again" keeps the sizes.
* Catalogue: the price shows the unit ("€25 / m²"), the button says "Choose size" and leads to the product page.
* Classic and block cart / checkout, HPOS compatible.
* Currency switchers that convert product prices through WooCommerce filters convert the size price too (tested with CatCode Multi Currency); taxes and coupons work as usual.

* Interface in English, Ukrainian, Russian and Spanish.

**Pro** (7-day free trial, no card)

* Price formula: width, height, depth, length, measure, perimeter, price, qty with min, max, ceil, floor, round, if — e.g. `measure * price + perimeter * 4`.
* Width × height price table (like blinds and roller shutters): paste the grid from Excel; the customer pays the nearest larger cell.
* Size → existing SKU matrix: a chosen size resolves to one of your existing products or variations, which goes into the cart with its own price and stock. Sizes without a matching SKU, or out of stock, cannot be ordered.
* Volume discounts by the total ordered measure (from 10 m² −5 %, from 50 m² −12 %).
* Setup fee per cart line and minimum price per piece.
* Stock kept in measure units: the stock quantity counts m² (or m, m³), and an order takes billed measure × pieces.

== External services ==

This build checks its Pro licence key on catcode.com.ua. Only when a key is entered or the 7-day trial is requested, and then once a day, it sends the key (or the e-mail for the trial), the site address and the module name to `https://catcode.com.ua/wp-json/catcode/v1/license` and `/trial`. Nothing is sent from a store without a key. Terms: https://catcode.com.ua/terms/ · Privacy: https://catcode.com.ua/privacy/

== Installation ==

1. Upload the plugin and activate it (WooCommerce must be active).
2. Edit a product and set its price as the price per unit (e.g. 25 for 25 per m²).
3. Product data → "Size pricing" → tick "Sell by size", choose length, area or volume, the units and the limits.
4. Save and open the product page: the size fields and the live price are above the "Add to cart" button.

Store-wide settings: WooCommerce → Size Price Calculator.

== Frequently Asked Questions ==

= Which price is used as the price per unit? =

The product's current price — the sale price when a sale is on. For variable products, the price of the chosen variation.

= Can the customer only pick from fixed sizes? =

Yes. Enter the allowed values in "Only these values" for that dimension (e.g. `2; 4; 6; 8`) — the field becomes a drop-down.

= How are the minimum and the rounding applied? =

Per piece: the real area is calculated first, raised to the minimum if it is smaller, then rounded up to the step. The cart shows both — "0.96 m² (billed as 1 m²)".

= Does the quantity field still work? =

Yes. Quantity is the number of pieces of that size; each piece is priced by its size.

= Can products sold by size be added to the cart from the shop page? =

No — they need a size first, so the catalogue button leads to the product page.

= What happens to the sizes if I delete the plugin? =

Sizes already saved in orders always stay. The plugin settings are removed; the size rules of products only if you tick "Delete data on uninstall" in the settings.

== Screenshots ==

1. Size fields and the live price on the product page.
2. Sizes, area and the billed area in the block cart.
3. The "Size pricing" tab in Product data.
4. WooCommerce → Size Price Calculator: how-to, the list of products sold by size and the settings.

== Changelog ==

= 1.0.0 =
* First release.
