=== Ukrposhta International for WooCommerce ===
Contributors: catcodestudio
Tags: woocommerce, shipping, ukrposhta, international shipping, customs
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ukrposhta international shipping rates in the WooCommerce cart, calculated live from the weight and size of the order. Pro: shipments with CN22 / CN23 from the order.

== Description ==

Ukrainian shops that ship abroad with Ukrposhta usually quote international delivery by hand: the customer places the order, the manager checks the Ukrposhta calculator and writes back with a price. This plugin puts that price straight into the checkout.

It adds an "Ukrposhta International" shipping method to your WooCommerce zones. For every destination outside Ukraine it asks the Ukrposhta eCom API (`/international/delivery-price`) for the price of the cart and shows it like any other shipping rate. Countries, shipment types and sizes Ukrposhta does not accept simply do not get the method.

= Free features =

* Live Ukrposhta rate abroad, by destination country, weight and dimensions of the cart.
* Shipment types: small packet (up to 2 kg), parcel (up to 30 kg, bulky parcels too), EMS, Prime; air or ground. Automatic mode: a small packet while the cart fits, a parcel otherwise — and a parcel when Ukrposhta does not take small packets to that country.
* Add the method twice to one zone to offer, for example, a parcel by air and EMS side by side.
* The cart is priced as one box: total weight, total volume, the longest item as the longest side; packaging weight is added.
* Customs data per product: HS code, name in Latin letters, country of origin (variations inherit them). For the US the goods go into the quote, as Ukrposhta requires, and the duty estimate is shown next to the rate.
* Optional declared value (insurance) for parcels and EMS.
* Checkout guard: when this method is chosen, the address has to be in Latin letters and a phone number is required — as Ukrposhta requires for international shipments. Classic and block checkout.
* UAH and USD stores work out of the box; any other currency with an exchange rate setting.
* Rates are cached; a flat fallback price, or hiding the method, when the Ukrposhta API does not answer.
* "Test connection" button that prices a 1 kg parcel to a country of your choice and shows Ukrposhta's answer.
* HPOS and the block checkout are supported. Ukrainian and Russian translations included.

= Pro features =

* Markup on the rate: a percentage and a fixed amount.
* Free international shipping above an order total.
* Orders over 30 kg are split into several parcels / EMS shipments and priced together instead of disappearing from the checkout.
* International shipment from the order screen in one click: recipient address and client, customs items with HS codes, barcode.
* CN22 / CN23 customs declarations, labels and all forms as PDF; deleting a shipment that was not handed in yet; status refresh.
* Tracking number with a link in the order e-mails and in My account.

A fresh install is simply the free tier. The 7-day Pro trial starts only when you click "Try Pro for 7 days".

= Requirements =

* A contract with Ukrposhta and the eCom API keys: the Bearer key for rates; the user (counterparty) token and a sender with an address in Latin letters for shipments. Ukrposhta issues them through your manager or api-support.
* WooCommerce 7.0+, PHP 7.4+.

== Installation ==

1. Upload and activate the plugin.
2. WooCommerce → Ukrposhta International: enter the eCom Bearer, save, press "Test".
3. WooCommerce → Settings → Shipping: add "Ukrposhta International" to the zones that cover the countries you ship to.
4. Fill in the HS code and the Latin name on the products you sell abroad (Product data → Shipping).

== Frequently Asked Questions ==

= Why does the method not appear for some countries? =

Ukrposhta refused that country with that shipment type (for example, some countries do not take small packets), or the cart is heavier / larger than the type allows. Turn on the log in the settings to see Ukrposhta's exact answer in WooCommerce → Status → Logs.

= Why is the US not quoted? =

For the US Ukrposhta prices only with the goods: every product needs a 10-digit HS code (or set a default HS code in the settings).

= Is the customs duty added to the shipping price? =

No. The estimate Ukrposhta returns is shown next to the rate for information only.

== Changelog ==

= 1.0.1 =
* Activating the Pro version while the free copy "CatCode International Shipping with Ukrposhta for WooCommerce" from WordPress.org is active no longer ends in a fatal error: the free copy steps aside, the Pro version runs on the same settings. Deleting the Pro version while the free copy is installed removes only the licence.

= 1.0.0 =
* Initial release.
