*** Express One Changelog ***

2025-12-24 - version 1.0.1
* Initial release
* Add - Core functionality for Orders created via WooCommerce are forwarded to Express One, converted into shipments, create barcode, tracking etc.
* Add - WooCommerce compatibility (tested up to WooCommerce 10.3.5)
* Add - Basic settings page with configuration options
* Add - Internationalization (i18n) support
* Dev - Code structured for maintainability and future enhancements

2026-03-26 - version 1.0.2
* Add - HPOS (High-Performance Order Storage) compatibility: all order meta now uses WooCommerce order CRUD (`get_meta`, `update_meta_data`, `save`) instead of `get_post_meta` / `update_post_meta`
* Add - `express_one_is_hpos_enabled()` helper to detect whether WooCommerce custom orders table is active
* Add - `express_one_get_order_edit_url()` helper to generate the correct order edit URL for both HPOS and legacy post-based orders
* Add - `express_one_build_collies()` helper to distribute order items across a configurable number of collies using round-robin logic
* Add - Collie count modal on order edit screen: admins can now specify how many collies to use when creating or updating a shipment (capped to number of order items)
* Add - `admin-collie-count.js` script enqueued on order edit screens (both legacy and HPOS) with localized modal strings
* Add - `data-max-collies` attribute on Create and Update Shipment buttons for JS validation
* Fix - Admin notices now correctly detect the order edit screen under both legacy (`post.php?post=`) and HPOS (`admin.php?page=wc-orders&id=`) URL formats
* Fix - `express_one_admin_error_redirect()` now uses transients for error messages instead of passing them in the query string, consistent with success notices
* Fix - Bulk label handler now loads the full order object via `wc_get_order()` before reading shipment meta, ensuring HPOS compatibility
* Dev - "Create Express One" button label renamed to "Create Express One Shipment" for clarity
* Dev - Order action button HTML restructured into a wrapping `<p>` tag for consistent spacing

2026-03-30 - version 1.0.3
* Fix - Parcel Shops error dialog fixed for different page builders

2026-05-20 - version 1.0.4
* Add - Approximate Location Check Added
* Fix - Location Availability Removed in Parcel Shop Location Selection

2026-06-01 - version 1.0.5
* Add - International shipping eligibility check for Home Delivery: non-SI destinations are now validated against the Express One API before checkout is allowed
* Add - WooCommerce Blocks (Gutenberg) checkout support for country eligibility validation via Store API hook
* Fix - Country eligibility check now works for both classic shortcode checkout and block-based checkout

2026-08-05 - version 1.0.6
* Fix - Bulk "Print Labels" action on the Orders list no longer silently no-ops when WooCommerce/HPOS passes the selected order IDs under an unexpected request key; the handler now falls back to reading the raw request so the action always runs
* Fix - Bulk "Print Labels" now always shows a result notice: an explicit "No orders were selected" notice if nothing was picked up, instead of doing nothing
* Fix - Label PDF generation failures (label API HTTP errors, non-2xx responses, empty/undecodable label data, failed disk writes) are now surfaced as a clear error notice instead of failing silently
* Fix - Missing API Key / missing Label Layout ID during bulk label creation now show a normal admin notice instead of a dead-end wp_die() screen

2026-08-06 - version 1.0.7
* Fix - "cargo" flag set to false when creating a new shipment (express_one_handle_create_shipment); the shipment update request (express_one_handle_update_shipment) still sends "cargo" as true

2026-08-14 - version 1.1.0
* Add - New "Pickup Shipment (Weight-Based)" and "Home Delivery Shipment (Weight-Based)" shipping methods, priced dynamically by parcel weight, grouped per destination country with a "Default" fallback group for any country without an explicit override
* Add - Optional maximum parcel size (sum of length + width + height) limit for the weight-based Pickup method
* Add - The new methods reuse the existing pickup-point map selection and Home Delivery courier API eligibility checks
* Add - Weight-based methods become unavailable at checkout if the cart's destination country/weight falls outside every configured tier, or if any cart item is missing its Weight (or, for Pickup with a size limit set, its Length/Width/Height) — unless the cart already qualifies for free shipping
* Add - Weight-based methods and their original (fixed-rate) counterparts are now mutually exclusive: enabling one automatically disables the other, with an admin notice explaining why
* Add - New admin settings pages under Express One for the weight-based methods
* Dev - Internal refactor, no functional changes to the existing fixed-rate methods: split the single plugin file into includes/ (shipping-helpers, pickup-map, order-integration, admin-settings, one file per shipping method class) and includes/traits/, deduplicating postcode matching, country matching, shipping-method registration, and the negative-price cart label that were previously copy-pasted across the Pickup and Home Delivery classes
* Dev - Verified byte-for-byte: all API endpoint URLs, nonce action strings, existing saved option names, and the two original shipping method IDs are unchanged, so existing shipping zone configuration and saved settings keep working without any action needed

2026-10-21 - version 1.2.0
* Fix - Shipping price on classic checkout/cart now follows WooCommerce's "Display prices during cart and checkout" tax setting. When prices are shown including VAT, the Express One rate label now shows the VAT-inclusive amount, matching WooCommerce Blocks. Order total calculation is unchanged
* Fix - Shipments are now always picked up from a pickup address registered for the customer in NESY. The manually typed "Sender Information" fields were removed from Main Settings; a "NESY Pickup Address" dropdown (loaded from the Express One /senders API) replaces them and its sender ID is sent on shipment create/update. With no address selected, NESY uses the account's default pickup address
* Fix - Classic checkout rejected Pickup orders with "You must select a pickup point" although a point was selected and shown. Picking a point changed the shipping country field, which started a checkout refresh in parallel with the AJAX call storing the point, and the hidden fields could be missing or emptied. The selection is now kept in the browser and written back into the form after every checkout refresh and right before submit (hidden fields are injected into the form if the theme does not render them), every checkout refresh copies the posted point back into the session, the point is stored before the address fields are changed, and the classic checkout validation and order creation fall back to the session
* Add - "Select a pickup point" / "Change pickup point" button rendered on classic checkout (woocommerce_review_order_before_submit) when a Pickup method is chosen, so the map can be reopened once closed
* Add - Blocks (Store API) checkout now requires a pickup point for Pickup methods and writes the parcel shop address plus "Pickup Point" meta onto the order
* Fix - Parcel shop names were HTML-escaped before being written into the hidden inputs, so a name containing "&" was stored on the order as "&amp;"
* Add - "Create Express One Shipments" bulk action on the Orders list: creates the Express One shipment for every selected order in one step, so orders no longer have to be opened one by one before bulk printing. Each new shipment gets one collie per order item (the same default as the order screen button) and the order is marked completed, as with the single-order button
* Add - "Create Shipments & Print Labels" bulk action: creates the missing shipments for the selected orders and returns one PDF with the labels of all of them. Orders that already have a shipment are not sent again; their existing label is included. A result notice lists created orders, skipped orders and each failed order with the Express One API error message
* Fix - Bulk actions (including "Print Labels") are now also available on the legacy (non-HPOS) WooCommerce Orders screen* Localization - Slovenian translations added for all strings missing from the language files (NESY pickup address, bulk shipment actions, pickup point button, collie count dialog, weight-based methods and other admin/checkout messages); the pickup map texts in checkout-map.js ("Pickup Point Selected:", "Select this point", map title, "No pickup points available", "Change pickup point") are now translatable instead of hard-coded English. .pot/.po/.mo files updated
* Localization - Slovenian translations added for all strings missing from the language files (NESY pickup address, bulk shipment actions, pickup point button, collie count dialog, weight-based methods and other admin/checkout messages); the pickup map texts in checkout-map.js ("Pickup Point Selected:", "Select this point", map title, "No pickup points available", "Change pickup point") are now translatable instead of hard-coded English. .pot/.po/.mo files updated
* Fix - Slovenian translation is now also shipped as express-one-shipment-sl_SI.po/.mo (WordPress's Slovenian locale is sl_SI, so the existing si_SI files were not picked up on Slovenian sites); si_SI files are kept unchanged
