=== Onlinefotka Payment/Shipping Icons ===
Contributors:      onlinefotka
Tags:              woocommerce, shipping, payment, icons, checkout
Requires at least: 6.3
Tested up to:      7.0
Requires PHP:      7.4
Stable tag:        1.1.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Add custom icons, notes, dynamic cutoff messages and delivery time slots to WooCommerce shipping and payment methods.

== Description ==

**Onlinefotka Payment/Shipping Icons** lets you enhance every shipping and payment method in WooCommerce with:

* **Custom icon** — upload any image from the Media Library (PNG, SVG, WebP). Choose from 4 display positions: before, after, above or below the method name.
* **Static note** — a short description shown under the method label in the cart and checkout (e.g. "Delivery in 2–3 business days").
* **Dynamic cutoff message** — a time-based message that changes automatically depending on when the customer orders. Example: before 12:00 → "Order now and we'll deliver today!", after 12:00 → "Delivery tomorrow morning."
* **Delivery time slots** — let customers pick a preferred delivery window (e.g. 08:00–12:00) directly in checkout. The chosen slot is saved to the order and visible in the order detail in the admin.

= Compatibility =

* ✅ Classic WooCommerce checkout
* ✅ WooCommerce Block Checkout (Gutenberg)
* ✅ WooCommerce HPOS (High-Performance Order Storage)
* WooCommerce 7.0+

= Icon position options =

Icons can be placed in 4 positions, configurable per method via the admin UI or overridden with CSS using the `.opsi-method-wrap` wrapper and `.opsi-pos-before / after / above / below` modifier classes.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin.
3. Go to **WooCommerce → Ikony dopravy a platby**.
4. Click on any shipping or payment method card to expand it.
5. Upload an icon, add a note, set cutoff rules and/or delivery time slots.
6. Click **Save changes**.

== Frequently Asked Questions ==

= Does it work with the WooCommerce Block Checkout? =
Yes. The plugin uses a WooCommerce Blocks IntegrationInterface to pass data to JavaScript, which injects icons and notes into the block-rendered checkout without modifying any templates.

= Where can I see the chosen delivery time slot? =
In the WooCommerce order detail page under the shipping address section, and in the customer-facing order confirmation page.

= Can I style the icons with CSS? =
Yes. Each method label is wrapped in `.opsi-method-wrap.opsi-pos-{position}`. You can override the layout, icon size, gap and anything else from your theme's CSS.

= How do cutoff rules work? =
Rules are evaluated top to bottom. The first rule whose time has not yet passed is applied. The "fallback message" is shown after all cutoff times have passed for the day.

Example:
* Rule 1 — 12:00 → "Order now and we'll deliver today!"
* Rule 2 — 14:00 → "Delivery tomorrow morning."
* Fallback — "Delivery in 2 days."

= Does it slow down my site? =
No. All settings are stored in a single WordPress option. The frontend CSS and JS are enqueued only on cart and checkout pages.

== Screenshots ==

1. Plugin admin page — list of shipping methods with zone badges.
2. Method card expanded — icon upload, position picker, note, cutoff rules and time slots.
3. Checkout frontend — icon and dynamic cutoff message next to the shipping method.
4. Delivery time slot selector in checkout.

== Changelog ==

= 1.1.0 =
* Fix: Plugin folder renamed to match wp.org slug — existing installations now update correctly.
* Add: Custom HTML template field per shipping/payment method.
* Add: `opsi_method_template` filter hook for developers.
* Fix: Icon media picker always applied to the first method instead of the clicked one.
* Fix: PHP fatal error when multiple Onlinefotka plugins are active simultaneously.
* Add: "Our other plugins" sidebar panel on settings page.
* Add: PayPal donate link in plugin header and plugins list.

= 1.0.3 =
* Add: Custom HTML template field per shipping/payment method.
* Add: `opsi_method_template` filter hook for developers.
* Improve: Note field description now mentions HTML support.

= 1.0.2 =
* Fix: Icon media picker always applied to the first method instead of the selected one.

= 1.0.1 =
* Fix: PHP fatal error when multiple Onlinefotka plugins are active simultaneously (class_exists guard).
* Add: "Our other plugins" sidebar panel on settings page.
* Add: PayPal donate link in plugin header and plugins list.

= 1.0.0 =
* Initial release.
* Custom icons for shipping and payment methods.
* Static notes per method.
* Dynamic cutoff messages (time-based).
* Delivery time slot selector.
* 4 icon positions (before / after / above / below).
* Full WooCommerce Block Checkout support.
* HPOS compatible.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade needed.
