=== Unit Price Grundpreis for WooCommerce ===
Contributors: catcodestudio
Tags: grundpreis, unit price, base price, pangv, woocommerce
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

Shows the unit price (Grundpreis) per 1 kg, 1 l, 1 m or 1 m² next to every product price, as the German PAngV requires.

== Description ==

A shop in Germany that sells goods by weight, volume, length or area — coffee, oil, fabric, flooring, soil — has to show the **unit price** (Grundpreis) next to the total price: the price per 1 kilogram, 1 litre, 1 cubic metre, 1 metre or 1 square metre. That is § 4 and § 5 of the Price Indication Ordinance (Preisangabenverordnung, PAngV).

You enter the net content of a product once — 500 g, 0.75 l, 2.5 m, 12 m² — and the plugin works the unit price out from the price the customer sees and puts it next to that price:

> 12,90 €
> Unit price: 25,80 € / 1 kg

= What it does =

* **Net content for products and variations** — one field and a unit in the product editor; a variation can have its own content or share the parent's.
* **Worked out, not typed:** the unit price follows the price, the sale price while a sale runs, and the shop's VAT display. Change the price — the unit price changes with it.
* **The reference quantities of § 5 PAngV:** 1 kg, 1 l, 1 m³, 1 m, 1 m² by default; 100 g / 100 ml for loose goods (§ 5(2)); another quantity for goods usually sold in 50 kg, 100 l, 100 m and more (§ 5(1) sentence 2); per application, e.g. per wash load, for household detergents (§ 5(5)).
* **Drained weight** for food in a liquid medium — the unit price is quoted per the drained weight (§ 5(4)).
* **Exemptions of § 4(3):** no unit price under 10 g / 10 ml, and a switch per product for the other exempt goods. Optionally left out when it equals the total price (§ 4(1) sentence 2).
* **Everywhere the price is:** product page, the selected variation, shop and category listings, search, related products, the product blocks, the cart and mini-cart, and the cart and checkout blocks.
* **Variable products:** a range of unit prices before a variation is chosen, the exact one after — also when all variations cost the same but differ in content.
* A preview in the product editor shows what the customer will see.
* Your own wording with {price}, {quantity} and {content}, on its own line or right after the price, and a shortcode `[ccupg_unit_price]` for page builders.
// @pro-begin
* German translation included.
// @pro-end

// @pro-begin
= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/unit-price-grundpreis-woocommerce/), with a 7-day trial that never starts by itself:

* **Orders and e-mails** — the unit price stays on every order line: order confirmation, e-mails, the order in the admin, invoices that print order item meta.
* **Structured data** — the net content and reference quantity in the product JSON-LD (referenceQuantity), the way Google reads unit pricing.
* **Net content from the product name or an attribute** — "Kaffee 500 g", "6 x 0,33 l": preview, then fill in the whole catalogue at once, or on every save.
* **Catalogue check** — the products of your food, drinks or DIY categories that still have no net content, with a CSV.
* **CSV columns** in the WooCommerce product import and export.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends.
// @pro-end

= Not legal advice =

The plugin applies §§ 4 and 5 of the German Preisangabenverordnung of 12 November 2021 (in force since 28 May 2022). Whether a product needs a unit price, and which reference quantity fits it, is the shop's decision; other EU countries have their own rules.

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. Open a product, Product data → General → "Unit price (Grundpreis)", and enter the net content and its unit.
3. Save — the unit price appears next to the price. WooCommerce → Unit price holds the display settings.

== Frequently Asked Questions ==

= Why not 100 g for small packs? =

The PAngV in force since 28 May 2022 quotes pre-packaged goods per 1 kg or 1 l (§ 5(1)); 100 g / 100 ml is allowed only for loose goods, weighed or measured for the customer (§ 5(2)). The plugin offers 100 g / 100 ml as a per-product choice for such goods.

= Which price is the unit price worked out from? =

From the price the customer sees on the page: the sale price while a sale runs, with VAT as the shop displays it (§ 2 no. 4 PAngV: the unit price includes VAT). In the cart it follows the cart's VAT display.

= The variations cost the same but have different sizes. =

WooCommerce normally hides the price of the chosen variation when all variations cost the same. The plugin shows it whenever the variation has a net content, so the customer sees the right unit price.

= Does it work with block themes and page builders? =

The line is added to WooCommerce's price HTML, which classic templates, the product blocks and most builders print. The cart and checkout blocks get it through the Store API. Where a builder prints the price its own way, use the shortcode.

== Changelog ==

= 1.0.0 =
* First release: net content for products and variations, unit price per the reference quantities of § 5 PAngV (standard, loose goods, large quantities, applications), drained weight, exemptions of § 4(3), display next to prices, in listings, variations, cart, mini-cart and cart/checkout blocks, shortcode.
