=== IČO priradenie ===
Contributors: BestRanger
Donate link: https://michael.subak.sk/kontakt/
Tags: ruz, company-data, billing, vat, ico
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Autofill Slovak company billing details in WooCommerce admin orders using the RÚZ public API by IČO or DIČ.

== Description ==
This plugin adds an admin order metabox where you can enter IČO or DIČ and fetch company details from the RÚZ (Register účtovných závierok) public API.

It fills billing company name, street, city, postcode, and country, and it can also fill custom order meta fields for IČO, DIČ, and IČ DPH based on your setup (for example WPify Woo or Superfaktura). You can configure the meta field keys in the plugin settings.

= For customers =
An optional "Load from IČO" widget can be enabled on the WooCommerce checkout page. Customers enter their IČO (8-digit company ID) and click the load button — the billing company name, address, city, postcode, and country are filled in automatically. Works with both the classic WooCommerce checkout and the Gutenberg blocks-based checkout. Enable this feature in WooCommerce → IČO priradenie settings.

== Installation ==
1. Upload the plugin folder to /wp-content/plugins/
2. Activate the plugin in Plugins
3. Go to WooCommerce -> IČO priradenie and configure your meta field keys
4. Open an order in admin and use the metabox to fetch company data by IČO or DIČ
5. Save the order

== Frequently Asked Questions ==
= Where does the plugin get the data from? =
From the public RÚZ API (registeruz.sk).

= Does it work for a newly created order that is not saved yet? =
It fills the fields in the admin screen, then you need to save the order.

= Why are DIČ or IČ DPH sometimes not filled? =
Most commonly the configured meta field key is incorrect. Make sure you use the correct key and include the leading underscore if your field uses it, for example _billing_company_wi_tax.

== Changelog ==
= 1.2 =
* Fixed: settings no longer force a leading underscore on field keys — names like billing_icocislo are saved as-is.
* Fixed: order meta is now saved to both key variants (billing_x and _billing_x) for compatibility with other plugins.
* New: optional "Load from IČO" button on the checkout page for customers (classic and Gutenberg blocks checkout).

= 1.1 =
Update readme, compatibility, fixes

= 1.0 =
First release
== License ==
GPLv2 or later

== External Services ==
This plugin connects to the public API of the Register of Financial Statements (RÚZ) at registeruz.sk to retrieve company details.
When an administrator enters an IČO (Company ID) or DIČ (Tax ID) in the order edit screen and clicks “Load from RÚZ”, the plugin sends that identifier to the API and receives company data (company name and address details).
Data sent: IČO or DIČ entered by the administrator.
When: only on manual request (button click) — in wp-admin by an administrator, or on the checkout page by a customer if the checkout widget is enabled.
Purpose: auto-fill billing company fields in the WooCommerce order edit screen or on the checkout page.
Service privacy policy: https://www.registeruz.sk/cruz-public/content/Privacy_policy.pdf