=== Rozetka Delivery & Justin Shipping ===
Contributors: catcodestudio
Tags: woocommerce, shipping, rozetka, justin, ukraine
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 11.1
Stable tag: 1.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

ROZETKA Delivery and Justin (Silpo) pick-up points for WooCommerce: point picker on the classic and block checkout, ROZETKA waybills and labels on the order screen.

== Description ==

Two Ukrainian pick-up networks in one plugin, each as its own WooCommerce shipping method.

**ROZETKA Delivery** connects the store to the ROZETKA Delivery cabinet (rozetka.delivery) — the service that ships orders **from your own site**, not from the ROZETKA marketplace. The customer picks a city and a pick-up point from the live ROZETKA directory; the manager creates the waybill in one click, refreshes its status, opens the printable label or cancels the waybill without leaving WooCommerce.

**Justin** — the customer picks a Justin pick-up point in a Silpo store (about 300 points). The list is taken from justin.ua and cached for a day. Justin has no public API for waybills, so the shipment itself is created in your Justin account; the order shows the chosen point and its ID.

= Free =

* ROZETKA and Justin pick-up point pickers on the classic and the block checkout.
* The choice is saved on the order, fills the shipping address and is shown on the thank-you page, in the account and in e-mails.
* Flat price and a free shipping threshold for each method.
* ROZETKA waybill from the order screen: sender from the settings, recipient from the order; declared value, delivery payer, parcel weight and dimensions with store-wide defaults.
* Label as PDF, manual status refresh and waybill cancellation.
* HPOS (custom order tables) and block checkout compatible. Ukrainian, Russian and English.

= Pro =

* Cash on delivery: for the payment methods you list, the order total goes into the ROZETKA waybill as the amount to collect at the point.
* Hourly status refresh of open ROZETKA waybills.

7-day Pro trial from the settings screen, no card needed. A purchased licence (1–5 years) keeps the Pro features after the term; the term covers updates and support.

= What you need =

* ROZETKA Delivery: a cabinet and a static API token from it. The city and point search works without a token; creating waybills does not.
* Justin: nothing for the picker. For shipments — a contract and an account with Justin.

== Installation ==

1. Upload the plugin and activate it.
2. WooCommerce → Settings → Shipping → add **ROZETKA Delivery** and/or **Justin (Silpo pick-up points)** to the zone that covers Ukraine.
3. ROZETKA: paste the static API token, fill in the sender (city, pick-up point, name, phone) and the parcel defaults. Justin: set the price.

== Frequently Asked Questions ==

= Does the plugin quote a live delivery price? =

No. Neither ROZETKA Delivery nor Justin publishes a tariff API for shipments from your own site, so the price is set in each method.

= Can the plugin create Justin waybills? =

No. Justin gives API access only under a contract and has no public documentation, so the plugin stops at the pick-up point choice. Create the shipment in your Justin account using the point shown on the order.

= Where does the Justin list come from? =

From the public file justin.ua/geo/filials.json that the justin.ua site itself uses. It is not a documented API: if it changes or stops answering, the plugin keeps the last good copy and shows the error in the Justin method settings.

= Is this the ROZETKA marketplace integration? =

No. The marketplace has its own API where a waybill is tied to a marketplace order. This plugin talks to the ROZETKA Delivery cabinet, which accepts shipments from your own store.

= Which data leaves my store? =

ROZETKA: only what a waybill needs — recipient name, phone, chosen city and point, parcel weight and dimensions, order number and totals (rz-delivery-octopus.rozetka.ua). Justin: nothing; the plugin only downloads the public point list. Licence checks send the key and the site address to catcode.com.ua.

== Changelog ==

= 1.1.4 =
* Fixed (Pro): on the legacy order storage (HPOS off) the hourly waybill status update took the 50 latest orders of any kind instead of the orders with a ROZETKA Delivery waybill, so in a busy store older waybills could go without status updates. It now takes only orders with a waybill on both order storages.

= 1.1.3 =
* Fixed: a guest who creates an account at checkout (or on the order confirmation page) no longer gets the pick-up point as the new account's address.

= 1.1.2 =
* Fixed: after a ROZETKA Delivery or Justin order WooCommerce saved the pick-up point as the logged-in buyer's billing and shipping address (block and classic checkout), so the next checkout offered the point instead of the buyer's own address. The order still gets the point; the account keeps the buyer's address.

= 1.1.1 =
* Switching from ROZETKA Delivery or Justin to another shipping method puts the buyer's own street, city and postcode back into the address fields: before, a courier order left with the pick-up point as its delivery address.
* Picking a city or a point in the list no longer misses the click on the block checkout.

= 1.1.0 =
* Justin: new shipping method with a Silpo pick-up point picker; the list from justin.ua is cached for a day and kept when the source fails.
* Block checkout: the picker now appears under the shipping options and the order is refused without a chosen point.
* A point chosen for one method no longer leaks into an order shipped by another.
* ROZETKA city search starts from 3 letters — shorter queries were rejected by the API.
* Free and Pro: cash on delivery on the waybill and hourly status refresh are Pro, 7-day trial.
* Russian translation; WordPress 7.1 and WooCommerce 11.1 tested.
* Method id is now cc_rozetka_delivery; 1.0.0 settings are moved over automatically.

= 1.0.0 =
* First release: checkout picker, waybill creation, label, status refresh and cancellation.
