=== Zineps Shipping for WooCommerce ===
Contributors: Zineps
Tags: shipping, Zineps, woocommerce, shipping, ecommerce
Requires at least: 6.5
Requires PHP: 7.4
Tested up to: 6.9
Stable tag: 1.3.27
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The ultimate shipping solution for WooCommerce. Connect to top carriers, offer pick-up points, and automatically print labels from one dashboard.

== Description ==

*“Shipping shouldn’t slow you down.”*

When orders start piling up, shipping quickly becomes chaos. You’re printing labels manually, updating tracking links, juggling carrier portals — all while trying to keep customers happy.

*Zineps changes that.*

We built Zineps to help modern webshops scale their shipping — without scaling their headaches.

---

### 🚀 What you get with Zineps:

•⁠  ⁠🏷️ *Automatic shipping labels* — Create and print labels in one click
•⁠  ⁠📍 *Pick-up point selector* — Let customers choose where they receive their package
•⁠  ⁠🌍 *Multi-carrier support* — Ship with PostNL, DHL, DPD, UPS, GLS, Correos, SEUR, CTT, Colissimo & more
•⁠  ⁠🔁 *Branded return portal* — Make returns smooth for your customers
•⁠  ⁠📦 *Live Track & Trace* — Automatically share tracking info via email and dashboard
•⁠  ⁠⚡ *Scan & Go* — Print labels with barcode automation
•⁠  ⁠💼 *Bring your own carrier contracts* — Or use discounted Zineps rates

---

Zineps is the shipping layer between your WooCommerce store and the rest of the world.
Built for speed. Built for simplicity. Built for scale.

🧑‍💻 Requires a Zineps account. Start at [https://zineps.com](https://zineps.com)

== Installation ==

1.⁠ ⁠Upload the plugin to your `/wp-content/plugins/` directory or install via the WordPress Plugin Directory.
2.⁠ ⁠Activate the plugin from your WordPress dashboard.
3.⁠ ⁠Go to WooCommerce > Zineps API Settings.
4.⁠ ⁠Enter your Client ID, Client Secret, and Shop Name, then save the settings.

== External Services ==

This plugin connects to the Zineps API to provide a seamless shipping experience. A Zineps account is required to use this plugin. The connection is used for the following functions:

1.⁠ ⁠Fetch Shipping Methods: When an administrator configures the shipping settings, the plugin sends the store's base country and the customer's destination country to retrieve a list of available carriers and services.
2.⁠ ⁠Find Pickup Points: When a customer selects a Zineps pickup point service on the checkout page, the plugin sends the customer's shipping address (postcode, city, and country) to the API to display a list of nearby locations.
3.⁠ ⁠Create Shipping Labels: When an administrator generates a label from the order overview page, the plugin sends the customer's full shipping details (name, address, email, phone) and the order reference number to the API.

This service is provided by Zineps. You can review their policies here:
*   [Terms of Use](https://zineps.com/terms/)
*   [Privacy Policy](https://zineps.com/privacy/)

== Screenshots ==

1.⁠ ⁠Carrier and pick-up point selection in the checkout process.
2.⁠ ⁠The admin panel with Zineps API settings.
3.⁠ ⁠An auto-generated shipping label available in the order overview.
4.⁠ ⁠Track & Trace information visible to customers.
5.⁠ ⁠The customizable branded return portal.

== Frequently Asked Questions ==

= Do I need a Zineps account? =
Yes – create one for free at [https://zineps.com](https://zineps.com)

= Which carriers are supported? =
PostNL, DHL, DPD, UPS, GLS, Correos, CTT, SEUR, Colissimo, Poste Italiane, and more.

= Can customers choose a pick-up point? =
Absolutely. Zineps includes a pick-up point selector in the checkout.

= Can I use my own shipping contracts? =
Yes. Zineps works with your own rates or our pre-negotiated ones.

= Is this plugin multi-language? =
Yes. Zineps supports EN, NL, DE, ES, FR, and IT.

== Changelog ==
= 1.3.27 =
* Fix: Selecting a pickup point no longer leaves the checkout stuck behind a loading spinner on classic checkouts.

= 1.3.26 =
* Fix: Pickup point selector shows again on classic checkouts (reads the billing address as fallback and finds the shipping method label reliably).

= 1.3.25 =
* Fix: Pickup point selector now falls back to admin-ajax when the REST request is blocked (e.g. caching or REST disabled), so it keeps working on all setups.

= 1.3.24 =
* Fix: Shipping method dropdown stayed empty when editing a method (event handler now binds to document so it loads reliably).
* Fix: Pickup point dropdown inherits the theme colours instead of forcing black on white.

= 1.3.23 =
* New: Checkout and admin requests now use the WordPress REST API for faster performance.
* Fix: Block checkout pickup dropdown opens reliably under the correct method and refreshes on address change.
* Fix: Admin shipping method dropdown no longer shows empty.
* Fix: Translations now load, and addresses like "31-77" parse correctly for labels.

= 1.3.23-beta3 =
* Fix: REST pickup bootstrap only initializes WooCommerce session (compatible with all WC versions).

= 1.3.23-beta2 =
* Fix: Bootstrap WooCommerce session in REST pickup endpoints (prevents 500 on checkout).

= 1.3.23-beta1 =
* Migrate plugin AJAX from admin-ajax.php to WordPress REST API (zineps-shipping/v1) for faster checkout and admin requests.

= 1.3.22 =
* Require pickup point selection at checkout when a pickup shipping method is chosen (classic and block checkout, WooCommerce 9.9+).
* Fix block checkout pickup selector: show inside selected rate, refetch on address change, loading indicator, and correct GetParcelShops URL with city.
* Fix admin race condition that duplicated shipping methods and overloaded GetAllContracts on checkout.
* Add bundled translations for Dutch, German, French, and Spanish.
* Fix Store API pickup_point extension for WooCommerce 9.9+ block checkout.

= 1.3.22-beta18 =
* Add bundled translations for Dutch (nl_NL), German (de_DE), French (fr_FR), and Spanish (es_ES).

= 1.3.22-beta17 =
* Fix: Block checkout pickup validation uses WooCommerce 9.9+ hook and onCheckoutValidation event.

= 1.3.22-beta16 =
* Fix: Store API pickup_point extension uses correct setExtensionData object format (WC 9.9+).

= 1.3.22-beta15 =
* Fix: Block checkout validation — require pickup point selection (Store API extension + client-side validation).

= 1.3.22-beta14 =
* Fix: Stop pickup dropdown refreshing while user selects a point; debounce address changes until postcode and city are complete.

= 1.3.22-beta13 =
* Fix: GetParcelShops URL must include city (resolve from cart or NL postcode lookup; skip call when city unknown).

= 1.3.22-beta12 =
* Fix: Dutch checkout layout where postcode/house number map to first_name/last_name (detect NL postcode, watch full cart address changes).

= 1.3.22-beta11 =
* Fix: Fetch pickup points when only postcode is known (city no longer required before AJAX call).
* Fix: Read postcode/city from visible block checkout form fields before cart sync (fresh guest checkout).

= 1.3.22-beta10 =
* Fix: Show pickup dropdown inside the selected shipping option (block checkout), not below all rates.
* Fix: Re-inject pickup UI when WooCommerce re-renders shipping rates after address change.
* Fix: Use cart shipping address as source of truth; refetch when cart address changes.

= 1.3.22-beta9 =
* Fix: Refetch pickup points when block checkout shipping address changes (keep selected method during rate reload, clear fetch dedupe, listen to address form save).
* Fix: Prefer visible block address form values over stale cart session when editing shipping address.

= 1.3.22-beta8 =
* Fix: Stop GetAllContracts storm on checkout (store carrier code on shipping method, single debounced pickup fetch).
* Fix: Call GetParcelShops only when postcode and carrier are known; persist PostNL carrier code per method instance.

= 1.3.22-beta7 =
* Fix: Use checkout POST/cart address for GetParcelShops (not stale session postcode).
* Fix: Preserve PostNL carrier code casing for parcel shop API.
* Fix: Refetch pickup points when block checkout shipping address changes.

= 1.3.22-beta6 =
* Fix: Resolve carrier code (e.g. POSTNL) from the shipping method contract/method for GetParcelShopsByCarrierAndPostCode.

= 1.3.22-beta5 =
* Fix: Stop checkout request loop hammering GetAllContracts (wp.data.subscribe fired on every cart update).
* Fix: Only clear pickup API cache when the shipping address actually changes.
* Fix: Cache contracts per request; normalize postcode for GetParcelShopsByCarrierAndPostCode.

= 1.3.22-beta4 =
* Fix: Pickup point JavaScript broken by PHP variable interpolation in inline script (block checkout).

= 1.3.22-beta3 =
* Fix: Pickup point selector not appearing on WooCommerce block checkout.

= 1.3.22-beta2 =
* Fix: Pickup points preload on block checkout and when the shipping address changes.
* Fix: Duplicate shipping methods in admin caused by overlapping AJAX requests.
* Fix: Translatable pickup point labels and messages.
* Fix: Loading indicator while pickup points are fetched.
* Fix: Pickup point validation for classic and block checkout (continued from beta1).

= 1.3.22-beta1 =
* Beta: Block checkout when a pickup point shipping method is selected but no pickup point was chosen.

= 1.3.21 =
* Refetch shipping methods on contract switch and pass carriercontractid to GetAllShippingMethods.

= 1.3.20 =
* Added a domain-specific Custom URL API mode for abczineps.nl with configurable API endpoint field.

= 1.2.3 =
* Fixed issues with connection testing
= 1.2.2 =
* Fixed issues with label generation
= 1.2.1 =
* Fixed errors
= 1.2.0 =
* New: Added an 'Auto-Complete Order' option. When generating a label, you can now mark the order as 'completed' in a single step, speeding up your workflow.
* New: Added a 'Free Shipping' threshold to each shipping method instance. You can now offer free shipping for orders over a certain value.
* Fix: Corrected a PHP 8.2+ deprecation notice related to dynamic properties.
= 1.1.0 =
* Major Admin & Reliability Update
* This is a significant update focusing on improving the user experience, making the plugin easier to set up, and increasing reliability.
* New: Live API Connection Verification: The settings page now automatically tests your API credentials and displays a clear "Working" or "Failed" status. This makes initial setup and troubleshooting much easier.
* New: Default Label Settings: You can now set a default carrier and shipping method in a new "Default Label Settings" tab. These will be pre-selected when you create a label, speeding up your workflow.
* Improvement: Redesigned Admin Settings Page: The Zineps Settings page has been completely redesigned with a modern, two-column layout and tabs for "API Settings" and "Default Label Settings" for better organization.
* Improvement: Enhanced Stability: The plugin now intelligently checks if the API connection is active before attempting to fetch data or create labels. This prevents errors and makes the plugin more robust, especially if your credentials are incorrect.
* Improvement: Clearer Error Messages: If there's an issue generating a label (like a disconnected API), the modal window will now display a clear, helpful error message.
* Behind the scenes: Major code refactoring and restructuring for better performance, security, and easier future updates.
= 1.0.0 =
* Initial release.
