=== ORLEN Paczka for WooCommerce ===
Contributors: sm32studio
Tags: shipping, pickup points, orlen paczka, delivery, woocommerce
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

ORLEN Paczka pickup points delivery for WooCommerce: point selection map in checkout, shipping labels and courier pickup ordering.

== Description ==

Official ORLEN Paczka integration for WooCommerce stores:

* pickup point selection map in the checkout (classic, block-based and CheckoutWC checkouts; popup or embedded map),
* shipping label generation from the order and the "Shipping history" page,
* courier pickup ordering and collective pickup protocols,
* pricing by parcel size (S/M/L), weight or cart value, with a free shipping threshold.

A partner account (PartnerID and PartnerKey) and a map widget token from ORLEN Paczka are required. To obtain them, contact integracje@orlenpaczka.pl.

== External services ==

This plugin connects to the ORLEN Paczka services operated by ORLEN Paczka (Poland):

1. ORLEN Paczka SOAP API (`api.orlenpaczka.pl`, test: `api-test.orlenpaczka.pl`) - used to generate shipping labels, order courier pickups and generate pickup protocols. The data sent includes the shop's PartnerID/PartnerKey, recipient name, address, phone number and e-mail address of the order being shipped, parcel size and the selected pickup point code. Data is sent when the shop administrator generates a label or protocol.
2. ORLEN Paczka map widget (`mapa.orlenpaczka.pl/widget.js`) - an interactive pickup point map loaded in the checkout so the customer can choose a pickup point. The widget is loaded in the customer's browser with the shop's map token; the customer's typed delivery address may be passed to the widget to centre the map. This script is an integral part of the ORLEN Paczka service and cannot be bundled with the plugin.

Terms of service and privacy policy of the service provider:
https://www.orlenpaczka.pl/regulaminy/ and https://www.orlenpaczka.pl/polityka-prywatnosci/

== Frequently Asked Questions ==

= Do I need an ORLEN Paczka account? =

Yes. The plugin requires an ORLEN Paczka business contract, API credentials (PartnerID, PartnerKey) and a map widget token. To obtain them, contact integracje@orlenpaczka.pl.

= Which checkouts are supported? =

The classic WooCommerce checkout, the block-based checkout and CheckoutWC - with a popup or an embedded map.

= Is the plugin compatible with HPOS? =

Yes, the plugin fully supports High-Performance Order Storage.

= Why is the ORLEN Paczka method not visible in the cart? =

Check the pricing configuration (ORLEN Paczka -> Konfiguracja cen) and the shipping zone. Since version 1.3.0 the exact reason is logged in ORLEN Paczka -> Logi.

== Installation ==

1. Upload the plugin and activate it.
2. Enter your PartnerID, PartnerKey and map widget token in ORLEN Paczka -> Dane autoryzacyjne.
3. Add the "ORLEN Paczka" shipping method to your shipping zone (WooCommerce -> Settings -> Shipping).
4. Configure prices in ORLEN Paczka -> Konfiguracja cen.

== Changelog ==

= 1.3.1 =

* Stores with themes rendering their own checkout form could not place an order ("Select an ORLEN Paczka pickup point" despite a selected point) - validation now honours the point saved in the session, like the block checkout; the session point is cleared after the order is placed.
* Faster pickup point map: in isolation mode the map preloads right after the ORLEN Paczka shipping method is selected and stays loaded between openings; the widget script uses the browser cache.
* The plugin no longer presents parcel amounts: removed the test-mode notice with the indicative label price and the panel banner.

= 1.3.0 =

* Full HPOS compatibility for parcel rows, labels, protocols, senders and courier pickup orders; legacy data remains visible.
* Fixed a Store API validation error blocking checkout on the block-based checkout.
* Embedded map saves full pickup point details from the first click.
* Fixed courier pickup ordering failing with a pack_code error despite correctly generated labels.
* Order edit screen no longer freezes the browser tab (map script loads on demand).
* Fixed a PHP warning ("Undefined variable $pickup_name") in order details.
* Product weight and dimensions converted according to the store units (grams-based stores saw a false "over 20 kg" warning).
* Integrator-facing pickup point fields carry the full shipping code; added delivery_point_* fields recognized by order-management systems (BaseLinker, Apilo).
* Shipping history queries recent ORLEN Paczka orders directly; HPOS-compatible order links; newest-first logs.
* Security hardening: input sanitization, nonce and capability checks across admin and AJAX endpoints.
* Added an "existing parcel number" field to restore a parcel entry without calling the API again.

== Upgrade Notice ==

= 1.3.0 =
Contains all bug fixes since 1.2.9, including required HPOS compatibility fixes. Back up before updating.
