=== Spain Couriers for WooCommerce ===
Contributors: catcodestudio
Tags: seur, correos express, spain, pickup point, cash on delivery
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

SEUR and Correos Express in one plugin: delivery to the address or to a pickup point at checkout, waybills, labels, tracking, cash on delivery.

== Description ==

Two Spanish couriers in one WooCommerce plugin, each with delivery to the buyer's address and delivery to its own pickup points: SEUR Pickup shops and SEUR lockers (SEUR 2SHOP), Correos Express offices and PaqPunto points.

**Free**

* Four shipping methods for your shipping zones: SEUR to the address, SEUR Pickup point or locker, Correos Express to the address, Correos Express office or pickup point. Shown for Spanish addresses only; per method you choose mainland Spain, the Balearic Islands, the Canary Islands, Ceuta and Melilla (read from the post code).
* Fixed price, free from an order amount (counted the way the cart shows it), free-shipping coupons, weight limit per method.
* Pickup point picker on the classic and on the block checkout: the list starts with the points of the buyer's post code; another post code or a street or name can be typed. Choose whether the checkout offers every kind of point or only one (SEUR shops or lockers; Correos Express offices or PaqPunto).
* The picker appears only while a pickup point method is chosen. The buyer's address fields are never rewritten in the browser, so switching to delivery to the address keeps the buyer's own address, and the address saved in the buyer's account stays theirs.
* The order is refused on the server when a pickup point method has no point, or a point the courier never listed — for any checkout. Other shipping methods are never blocked, and a point picked earlier never lands in an order shipped otherwise.
* The point is stored on the order (HPOS compatible), optionally written into the shipping address, and shown on the thank-you page, in the account and in e-mails, with tracking links.
* Waybill from the order screen: weight, cash on delivery (contra reembolso) for the payment methods you choose, declared value, PDF label (label printer or A4), status refresh, cancel. Orders shipped with another method can be sent too — pick the courier in the box.
* SEUR: services per destination (mainland, Balearic Islands / Ceuta / Melilla, Canary Islands), SEUR 2SHOP for points and lockers. Correos Express: product per destination, Paq 24 Oficina Elegida for offices, PaqPunto for points, Saturday delivery.
* Pickup points are asked from the courier per post code and kept for a day: a buyer never waits twice for the same post code.
* Test systems of both couriers supported (SEUR pre-production, Correos Express test), with the test users the couriers issue to you.
* Passwords and secrets stored encrypted. English and Spanish.

**Pro** (7-day free trial from the settings page)

* Live SEUR delivery price from your tariff at checkout (SEUR valuation), with a markup in % and a fixed amount, rounding, and the fixed price as a fallback when SEUR is slow. Correos Express has no price calculation in its API, so its methods keep the fixed price.
* Waybills created automatically when an order reaches the status you choose.
* Bulk actions in the orders list: create waybills, print all labels at once.
* Several parcels per waybill (to the address; points take one parcel).
* Hourly waybill status sync with order notes, and "Completed" once the courier reports the delivery.

You need a business contract with API access with each courier you use: SEUR (client ID and secret, API user, customer account CCC) and Correos Express (client code, API user and password).

== External services ==

This plugin connects to the couriers you configure, only with the credentials you enter:

* SEUR public API (servicios.api.seur.io, or the pre-production system servicios.apipre.seur.io) — sign-in, pickup points and lockers of a post code, price calculation, create / print / track / cancel shipments.
* Correos Express API (www.cexpr.es, or the test system www.test.cexpr.es) — offices and PaqPunto points of a post code, create / print / track shipments.

Sent when you create a waybill (or Pro automation does it for you): the order number, weight, parcel size, cash on delivery amount, declared value if you enabled it, parcel contents, the sender data from the settings, and the buyer's name, phone, e-mail and address or chosen pickup point. While the buyer is at checkout: the post code whose pickup points are listed (and, for Correos Express, the cart weight and value); with the Pro live SEUR price on, the destination post code and the weight. Tracking links open the couriers' public tracking pages.

Terms and privacy: https://www.seur.com/ and https://www.correosexpress.es/

The Pro licence check connects to catcode.com.ua (licence key and site address), only after you enter a key or start the trial.

== Installation ==

1. Install and activate the plugin.
2. WooCommerce → Spain Couriers: fill in the sender and the account of each courier you use and save.
3. Click "Check the connection" and "Find pickup points" to see that the courier answers.
4. WooCommerce → Settings → Shipping → your Spain zone → Add shipping method → the methods marked "(Spain Couriers)".

== Frequently Asked Questions ==

= The pickup point method does not appear at checkout =

It appears once the courier's API account is saved, for Spanish addresses in the parts of Spain chosen in the method. Check also the weight limit of the method.

= Can I cancel a Correos Express waybill? =

Correos Express has no cancel call in its API. "Cancel" marks the waybill cancelled in the shop and adds an order note; if the parcel was already handed over, call Correos Express.

= The live tariff shows the fixed price =

SEUR did not answer within a few seconds, refused the request, or returned 0. Turn on the debug log (source spain-couriers) to see why.

== Changelog ==

= 1.0.0 =
* First release: SEUR (address, Pickup shop, locker) and Correos Express (address, office, PaqPunto); pickup point picker on the classic and the block checkout; waybills, labels, tracking, cash on delivery; Pro live SEUR tariff, automatic and bulk waybills, bulk labels, several parcels, hourly status sync.
