=== Invictus Cjenik ===
Contributors: invictusdizajn
Tags: anchor price, price list, croatia, woocommerce, consumer protection
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 7.33.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Anchor (reference) price and a public product/service price list in XML and CSV format, per the Croatian Government Decision (NN 101/2026).

== Description ==

Invictus Cjenik marks existing price fields on selected pages (or builds a new price-list page itself if none exists yet), stores the anchor price (the reference price as of 10 September 2026) and generates a public price list in XML and CSV format - a requirement under the Croatian Government's Decision on publishing a price list of products and services (NN 101/2026, effective 1 October 2026).

Compatible with WPML and Polylang - the price is automatically shared across all translations, the price list does not duplicate rows per language, and the built-in, manually entered price list can have its own per-language page translations and per-row name/price prefix/unit/promotion name.

= Features =

* Links existing ACF fields with prices, without changing the existing page structure
* Built-in creation of a new price-list page (without ACF), with rows entered directly in the admin
* Linking by post type (e.g. "Products") - the mapping applies to all posts of that type
* Public price list in XML and CSV format, with a 30-day archive (Art. II of the Decision)
* Support for multiple business locations, with per-location price import via CSV
* CSV/XML import/export, with manual column mapping when the format doesn't match
* Multilingual support for the built-in price list (WPML or Polylang): automatic translated-page creation, and per-row translation of name/price prefix/unit/promotion name, also reflected in the CSV template, export and import
* Automatic plugin updates directly through Plugins in wp-admin

This is not legal advice.

== Installation ==

1. Copy the `invictus-cjenik` folder to `wp-content/plugins/`.
2. Activate the plugin.
3. Invictus Cjenik → Settings: choose the working mode (ACF, new page, post type) and enter the basic settings (prefix, default date).

== Changelog ==

= 7.33.0 =
* Merged the standalone "Invictus Cjenik Multilingual" plugin's functionality directly into this plugin (WPML/Polylang translated-page creation and per-row translations for the built-in price list) - no longer needs a separate plugin. If the old standalone plugin is still active on a site, this built-in version steps aside automatically to avoid duplicating translations, and shows a notice recommending it be deactivated.
= 7.32.4 =
* readme.txt is now in standard English (per WP Plugin Check); the Croatian version moved to readme-hr.txt.
= 7.32.3 =
* Fixes per the WP Plugin Check tool: added missing isset() checks and phpcs:ignore notes for fields sanitized further downstream (per row/block), and "Tested up to" raised to 7.1.
= 7.32.2 =
* The auto-update endpoint moved to files.invictus-dizajn.com (a separate subdomain, without the caching that was delaying new versions from showing up in Plugins).
= 7.32.1 =
* Fix: admin JS (needed for the dropdowns and chart on "Price History", as well as "Products & Services Overview", "Price List Archive" and "Look & Colors") now correctly loads on ALL tabs of the plugin - previously it only loaded on the main price-list-linking tabs, leaving those dropdowns empty.
= 7.32.0 =
* "Price History" tab: the table and chart for a selected item are now shown only after an item is chosen in the dropdown (previously they were all shown at once and hard to read).
* New "Available/Unavailable" option for products: a checkbox on the row in "Create a price-list page", or mapping a true/false ACF field for the other options - the item stays in the public XML/CSV product price list, with an added availability label. Also shown as a column in "Products & Services Overview", and as a column in the manual price list's CSV export/import.
= 7.31.0 =
* New "Price History" tab: a per-day price table for each item (last 30 days of archive) and a line chart of price movement over time (including anchor and sale price, when present), for a selected item - built from the existing archive, with no extra data storage.
= 7.30.0 =
* Bulk price editing in "Create a price-list page": increase/decrease the price, anchor price or sale price by a percentage or amount, set an exact amount, or round to ",99" - for all rows at once or only the selected ones.
* New "Table (compact) view" for rows - condenses the cards into a denser, table-like view for faster browsing/entry (toggle button, remembered per browser).
= 7.29.4 =
* Fix: the archive is no longer created for a type (products/services) that currently has no items at all in the price list - if the price list only has services, only services are archived (and vice versa); existing older records are left untouched.
* The "Price List Archive" tab no longer shows an empty section for a type that isn't used and was never archived.
= 7.29.3 =
* Fixed the field order in the manual price-list entry form (Price → Anchor price → Sale price → Promotion name) to match the order in the public price list.
= 7.29.2 =
* Unified price order in the public XML/CSV price list: always current (retail) price first, then anchor price, then (if present) sale price and the lowest price in 30 days.
= 7.29.1 =
* Fix: services are now archived only when the price actually changes (as before), not automatically every day - the daily archive regardless of changes remains for products only.
= 7.29.0 =
* New "Price List Archive" tab: an overview of all archived days (products/services), with a link to each public XML/CSV archive record.
* Delete a single archive day, or the whole archive, directly from the admin.
* When the field structure is upgraded (e.g. in 7.28.0), existing archive records are automatically backfilled with the new structure (without touching saved prices/names) instead of older days staying on the old structure - also available manually, via a button on the new tab.
= 7.28.0 =
* New "Promotion name" field (e.g. "Black Friday") - entered manually for items in the built-in price list, or mapped to an ACF/meta field for linked pages and post types.
* In the public XML/CSV price list, the "posebni_oblik_prodaje" field now shows the promotion name (text), and the new sale price is shown in a separate "akcijska_cijena" field.
* The trigger for "najniza_cijena_30_dana" changed to the presence of a sale price (not a promotion name).
* CSV templates, export and import extended with a new "akcija_naziv" column.
= 7.27.0 =
* Fixes per the WordPress Plugin Check tool: output escaping, input sanitization/unslashing, removed heredoc, date() replaced with gmdate(), added readme.txt and license.

= 7.26.1 =
* Test version to verify automatic updates.

= 7.26.0 =
* Automatic plugin updates directly through Plugins in wp-admin.
