=== Sunduqz Locker Delivery ===
Contributors: abdulmotalebalhajj
Tags: woocommerce, shipping, locker, delivery, checkout
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
WC requires at least: 7.9
WC tested up to: 9.4
Stable tag: 3.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds a Sunduqz smart-locker pickup option to WooCommerce checkout, for both Classic and Block Checkout, with no extra configuration.

== Description ==

Sunduqz Locker Delivery lets your WooCommerce customers choose to pick up their order from a Sunduqz smart locker instead of a home delivery address. The plugin adds a locker picker to your store's checkout page and automatically detects whether your store uses Classic (shortcode) or Block Checkout, so it works without any additional setup once connected.

**Features**

* Locker picker on checkout (Classic and Block Checkout, detected automatically)
* Locker details and driver pickup OTP attached to each order
* Order note and admin order screen display of the selected locker and OTP
* Customizable button colors and sizes from the WordPress admin
* Webhook notification to Sunduqz when a new order is placed

== External services ==

This plugin connects to the Sunduqz API (a smart-locker delivery network) to function:

* **Store connection** — when you enter your WooCommerce REST API key on the Sunduqz Connection settings screen, the plugin sends your store URL, store name, and that REST API key to the Sunduqz API to verify you control the store and link it to your Sunduqz account.
* **Pickup point map** — the checkout picker loads a map from the Sunduqz API so customers can browse and select a nearby pickup point, which may be a locker or a staffed counter.
* **Order webhook** — when a customer places an order with a pickup point selected, the order details (pickup point location, customer info required for delivery, and a driver pickup code) are sent to the Sunduqz API so the order can be routed to the correct pickup point.
* **Driver OTP generation** — at order-creation time, the plugin requests a one-time pickup code from the Sunduqz API.

No data is sent to Sunduqz until you connect your store from the plugin's settings screen. See Sunduqz's terms of service and privacy policy at [https://about.sunduqz.com/privacy-policy](https://about.sunduqz.com/privacy-policy).

== Support ==

For help with this plugin, contact support@sunduqz.com or visit [https://about.sunduqz.com](https://about.sunduqz.com).

== Installation ==

1. Upload the plugin through Plugins → Add New → Upload Plugin, or extract it into `wp-content/plugins/`.
2. Activate the plugin through the "Plugins" screen.
3. Go to Sunduqz → Connection in wp-admin.
4. Generate a WooCommerce REST API key (Read/Write) at WooCommerce → Settings → Advanced → REST API, and paste it into the Connection screen to link your store.
5. The locker picker will now appear at checkout automatically.

== Frequently Asked Questions ==

= Does this work with Block Checkout? =

Yes. The plugin detects whether your Checkout page uses Block Checkout or the classic shortcode checkout and adjusts automatically — no configuration needed.

= Do I need to set up a shipping zone for Sunduqz? =

No. Locker selection is captured independently of whatever shipping method your store already uses.

= What happens if I deactivate the plugin? =

The plugin removes its webhook registration and disconnects your store from Sunduqz on deactivation.

== Changelog ==

= 3.0.3 =
* Checkout can now offer staffed pickup counters as well as lockers, and says which one the customer picked.
* A counter order's notes carry the name to ask for and any collection instructions, so the driver knows who to hand the parcel to.
* The shipping address line reads "Sunduqz Counter at ..." for a counter and is unchanged for a locker.
* Order meta is written under both _sunduqz_pickup_point and the existing _sunduqz_locker, so existing delivery-company integrations keep working.

= 3.0.2 =
* The locker picker now explains how locker delivery works before showing the map, and confirms your chosen locker with its photo and address.
* "Remove locker selection" is now "Deliver to my address instead", so it says what it does.
* The picker follows your store's language instead of always showing English.

= 3.0.1 =
* "How Sunduqz works" link now opens an in-page video modal instead of leaving the site.

= 3.0.0 =
* Merged Block Checkout support into the plugin — one plugin now serves both Classic and Block Checkout automatically.
* Server-side driver OTP generation, tied to actual order creation.
* Connection flow now uses a merchant-supplied WooCommerce REST API key instead of a bundled secret.

= 2.0.0 =
* Consolidated settings into a single Sunduqz admin menu.
* Added customizable button colors and sizes.

== Upgrade Notice ==

= 3.0.2 =
Clearer locker picker: it explains locker delivery up front and confirms the locker you chose, with its photo.

= 3.0.1 =
"How Sunduqz works" link now shows an in-page how-it-works video instead of opening a new tab.

= 3.0.0 =
Adds Block Checkout support. If you previously used a separate Sunduqz Blocks plugin, its settings are migrated automatically.
