=== Worten Conector - Tracking for Orders ===
Author URI: https://teracondition.pt
Plugin URI: https://mirakl.teracondition.pt
Contributors: teracondition
Tags: worten, worten marketplace, worten conector, mirakl, woocommerce tracking
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 2.9
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add carrier/tracking fields to WooCommerce orders, expose them via REST API, and add a "Marketplace" column with filter for Worten orders.

== Description ==

This plugin adds two fields to the WooCommerce order edit screen:

- **Carrier** (preloaded select list of Worten-supported carriers)
- **Tracking number**

The values are saved as order meta and automatically included in the WooCommerce REST API response for orders, making it easy for external services to read and use the data. It also adds a **"Marketplace"** column to the Orders table and a filter to view only **Worten** orders (detected via the customer note), helping back-office teams identify and manage marketplace orders efficiently.

> Note: This plugin **does not** send data directly to Mirakl/Worten; it makes the tracking and carrier information available in a structured way so that a cloud-based integration can automatically send the data to Worten Marketplace.

=== Key Features ===

- Order edit UI with **Carrier** (dropdown) + **Tracking** fields.
- Saves values to order meta on update.
- Exposes `carrier_name`, `carrier_code`, and `tracking_number` in the WooCommerce **REST API** order payload.
- Adds **"Marketplace"** column to Orders list; highlights and labels Worten orders.
- Adds **Orders filter** “By Marketplace → Worten”.
- Lightweight admin CSS for the Marketplace column.

=== REST API Fields ===

When reading an order via the WooCommerce REST API, the response includes:

- `carrier_name`
- `carrier_code`
- `tracking_number`

=== Carrier List (preloaded) ===

The "Carrier" dropdown includes the following options (subject to change in future releases):

4PX (`4px`), AB Custom (`ABC`), Asendia (`asendia`), ASM (`asm`), Austrian Post (`austrianpost`), Autoradio (`Autoradio`), BPOST (`bpost`), BRT (`BRT`), CAINIAO (`cainiao`), CBL Logistica (`cbllogistica`), CC Campos e Cadilhe (`camposcadilhe`), CELERITAS (`CELERITAS`), Chronopost France (`chronopostfrance`), COLISSIMO (`colissimo`), CNE (`cne`), Correos ES (`correosespana`), Correos Express (`correosexpress`), CTT (`ctt`), CTT Express (`cttexpress`), CTT Fulfillment (`CTHD`), CTT Fulfillment C&C (`CTSD`), CTT Fulfillment Espanha (`CEHD`), Cubyn (`cubyn`), DB SCHENKER (`dbschenker`), Delnext (`delnext`), Deutsche post (`de-post`), DHL (`dhl`), DHL España (`dhlespana`), DHL Express (`dhlexpress`), DPD (`dpd`), DPD.de (`DPD_DE`), DPD FR (`dpdfr`), DPD Fulfillment (`CHSD`), DPD HD PT (`CHHD`), ENVIALIA (`envialia`), FedEx España (`fedexespana`), FedEx Portugal (`fedexportugal`), GEL DE (`gel-express`), GLS (`gls`), GLS ES (`glsespana`), Kargo (`kargo`), Kerry Logistics (`kerrylogistics`), Landmark Global (`landmarkglobal`), La Poste (`laposte`), Logic (`Logic`), Luis Simões Fulfillment (`LSSD`), MarCa (`marcapt`), MRW (`mrwportugal`), MRW España (`mrwespana`), Nacex España (`nacexespana`), On time (`es-ontime`), Ontime (`ontime`), P2P (`p2p`), Paack (`Paack`), Post Luxembourg (`postluxembourg`), PostNL (`postnl`), Rhenus (`rhenus`), Santos e vale (`santosevale`), sending (`sending`), SEUR (`seurespana`), SGT (`sgt-it`), Spring (`spring-gds`), Szendex (`szendex`), TAMDIS (`tamdis`), TCT Transportes (`TCT`), TFS (`tfs`), TIPSA (`tipsa`), TNT (`tnt`), Track Cubyn (`trackcubyn`), Track Your parcel (`trackyourparcel`), TTM Fulfillment (`TTLF`), TXT (`TXT`), UPS (`ups`), UPS España (`upsespana`), Vasp Expresso (`vaspexpresso`), Venta-Unica (`ventaunica`), VIA DIRECTA (`viadirecta`), WANBEXPRESS (`wanbexpress`), We Pick Up (`wepickup`), WN Direct (`wndirect`), Worten Em 2H (`WEEXP`), Worten Entrega (`wortenentrega`), XPO Logistics (`xpologistics`), YanWen (`yanwen`), Your Parcel Hub (`yourparcelhub`), Yun Express (`yunexpress`), Zeleris (`zeleris`), Zelo (`zelo_pt`).

== Installation ==

1. Go to **Plugins** in your WordPress admin.
2. Click **Add New**.
3. Search for **Worten Conector – Tracking for Orders** and click **Install Now**, or upload the ZIP manually.
4. Click **Activate**.

== Frequently Asked Questions ==

= Does this plugin send data to Mirakl/Worten automatically? =
No. It stores carrier and tracking meta in WooCommerce and makes it available in a structured format so that a cloud-based integration can automatically send the data to Worten Marketplace.

= How are Worten orders identified in the Orders list? =
The plugin checks the order’s **customer note** for a "Worten Conector" marker, stores a `worten_marketplace` meta, and displays “Worten” in the **Marketplace** column. You can also filter orders by Marketplace = Worten.

= Which fields appear in the REST API response? =
`carrier_name`, `carrier_code`, and `tracking_number`.

== Changelog ==

= 2.9 – 2025-08-14 =
* Tested up to WordPress 6.8.
* Improved admin Orders **Marketplace** column and styling.
* Ensured `carrier_name`, `carrier_code`, `tracking_number` are present in REST responses.
* Updated and verified carrier list in the order edit UI.
* **Updated carrier list** with new transporters from Worten, added tracking URLs, and removed outdated entries.

= 2.8 – 2024-12-19 =
Maintenance and compatibility improvements.

= 2.7 – 2024-07-11 =
* Add shipment tracking data to the main endpoint structure.

= 2.6 – 2024-05-28 =
* Version compatible with WordPress 6.5.3

= 2.5 – 2024-03-22 =
* Addition of a filter by marketplace

= 2.4 – 2024-03-22 =
* Addition of a column in the order list, with information from the marketplace for better ease of visualization and filtering
* Version compatible with WordPress 6.4.3

= 2.3 – 2023-11-20 =
* Version compatible with WordPress 6.4.1

= 2.2 – 2023-10-19 =
* Version compatible with WordPress 6.3.2 and WooCommerce 8.2.0

= 2.1 – 2023-10-18 =
* Update version for WordPress 6.3.2

= 2.0 – 2023-10-10 =
* Update version for WordPress 6.3.1

= 1.8 – 2023-01-29 =
* Release final version

== Upgrade Notice ==

= 2.9 =
Adds REST exposure for tracking fields, improves Marketplace labeling in Orders, and updates the carrier list with the latest Worten-supported transporters.
