=== Postcode Delivery Zones for WooCommerce ===
Contributors: catcodestudio
Tags: woocommerce, postcode, delivery zone, minimum order, delivery date
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

"Do we deliver to you?" postcode check, a minimum order per postcode zone, no orders from outside your area, and delivery windows at checkout.

== Description ==

A shop with its own couriers — groceries, flowers, bakeries, furniture, catering — does not deliver "to Germany". It delivers to a list of postcodes, with a minimum order that depends on how far the van has to go, on certain days and in certain time slots. WooCommerce shipping zones can price that, but they cannot tell a shopper on the product page whether you deliver to them at all, and they cannot stop a 9 € order to a postcode that needs 40 €.

This plugin does exactly that.

**For the shopper**

* A "Do we deliver to you?" box on the product page: type a postcode, get a clear answer — and the minimum order for that area, and the earliest delivery window.
* The checked postcode is filled into the checkout, so nobody types it twice.
* The same box anywhere with the shortcode `[postcode_delivery_check]`.

**For the shop**

* Postcode lists in the WooCommerce syntax you already know: `10115` exact, `101*` starts with, `10000...10999` range. Paste a list from your courier, or import it from CSV (Pro).
* A minimum order per zone: below it the order cannot be placed — on the classic checkout and on the block checkout alike, checked again on the server when the order is submitted.
* Orders to postcodes outside every zone: refused, or only warned about — your choice.
* Countries per zone, for shops that deliver to Austria and Switzerland, where both use four-digit postcodes.
* Local pickup skips every check.

**Delivery windows (Pro)**

* Weekdays and time slots per zone, e.g. Mon–Fri 09:00–13:00 and 13:00–18:00.
* Lead time and a cut-off hour: "order by 14:00 for delivery tomorrow".
* Days off (holidays, stock-taking).
* A limit of orders per slot — a full slot is no longer offered, and a cancelled order gives its place back.
* The chosen window is stored on the order and shown on the order screen, the thank-you page, My account and in the e-mails.

**What works for free — for ever**

Up to three delivery zones with their postcode lists and minimum orders, the postcode check on the product page and in the cart, and the block on outside postcodes. That is not a countdown.

**Pro**

* As many zones as you need, each with its own minimum order and message.
* Delivery windows with slot limits.
* CSV import and export of postcodes.

**The trial only starts when you press the button.** A fresh install switches nothing on. When you want to try Pro — "Try Pro for 7 days" on the settings screen, an e-mail address, and the server issues a real 7-day key. The licence is annual (1–5 years) and covers updates and support for that term.

**Languages:** English, German, Ukrainian, Russian.

== Installation ==

1. Upload the plugin and activate it.
2. Open WooCommerce → Postcode zones.
3. Edit the example zone: its name, your postcodes, the minimum order. Switch it on and save.
4. Open any product — the "Do we deliver to you?" box is under the add-to-cart button.

== Frequently Asked Questions ==

= Does it replace WooCommerce shipping zones? =
No. Shipping zones keep pricing the delivery. This plugin decides whether you deliver to a postcode at all, and what the minimum order there is.

= Does it work with the block checkout? =
Yes. The checks run on the server for both checkouts. On the block checkout the delivery window is an additional checkout field in the order section.

= Is shipping counted towards the minimum order? =
No — goods after coupons, with or without tax (a setting). Shipping is unknown while the shopper is still in the cart, and a minimum that moves between pages confuses people.

= The box says "we deliver", but the checkout refuses the order =
Then the cart is under the zone's minimum order — the message at the checkout says by how much.

= A postcode is in two zones =
The first switched-on zone in the list wins. Put the narrower zone first.

= Where is the chosen delivery window stored? =
In the order meta `_ccpdz_window` (`YYYY-MM-DD|HH:MM-HH:MM`) and, readable, in `_ccpdz_window_label`.

== Changelog ==

= 1.0.1 =
* Fixed (Pro): on the legacy order storage (HPOS off) a delivery window with an orders-per-slot limit counted every order in the store instead of the orders booked for that window, so such windows showed as full and disappeared from the checkout. The count is now the same on both order storages.

= 1.0.0 =
* First release.
