# User guide — Simple Connection for ChronoFresh

Clear reference for day-to-day use.
If you understand this document, you can ship fresh, frozen and ambient parcels with Chronopost/Chronofresh without touching PHP.

French version: [MODE-DEMPLOI.md](MODE-DEMPLOI.md)

---

## 1. What is this plugin?

**Simple Connection for ChronoFresh** connects WooCommerce to the Chronopost/Chronofresh shipping API:

1. the customer picks a **ChronoFresh shipping method** at checkout (home delivery, agency or pickup point);
2. for pickup point methods, they select their point on an **interactive map** with opening hours;
3. you generate the **shipping label (PDF)** from the order page, in one click or in bulk;
4. the customer automatically receives a **tracking email**, and you can follow or cancel the parcel from the order.

It supports the three temperature ranges of the Chronofresh network: **Ambient**, **Fresh (0°C – 8°C)** and **Freeze (< −18°C)**.

---

## 2. Requirements

- An active **Chronofresh contract** (contact your Chronopost sales representative).
  For testing, use the official test account `19869502` / password `255562`.
- The **PHP SOAP extension** enabled on your server (check WooCommerce → Status).
- **WooCommerce** active, with a complete store address (Settings → General) — it is printed on the label as the sender.

---

## 3. Quick install

1. Activate **WooCommerce**.
2. Activate **Simple Connection for ChronoFresh**.
3. WooCommerce → **ChronoFresh** → enter your account number, password and shipper phone.
4. Click **Test API connection** to validate your credentials.
5. WooCommerce → Settings → **Shipping** → add the ChronoFresh methods to your shipping zones.

---

## 4. Shipping methods and product codes

Add these methods in WooCommerce → Settings → Shipping → your zone:

| Method | Chronopost code | Use case | Pickup point? |
|--------|-----------------|----------|---------------|
| Chrono Ambient 13h | `5M` | Ambient, home delivery | No |
| Chrono Ambient Instance | `5N` | Ambient, agency pickup | No |
| Chrono Ambient Relais 13h | `5Q` | Ambient, pickup point | Yes |
| Chrono Fresh 13h | `2R` | Fresh (0°C – 8°C), home delivery | No |
| **Chrono Fresh Relais 13h** | `6S` | **Fresh (0°C – 8°C), pickup point** | Yes |
| Chrono Freeze 13h | `2S` | Frozen (< −18°C), home delivery | No |
| Chrono Relais 13h | `86` | Standard, pickup point | Yes |
| Chrono Instance 13h | `1S` | Standard, agency pickup | No |

> **New in 1.2.0** — *Chrono Fresh Relais 13h* (`6S`): Chronofresh offers fresh delivery to pickup points since the beginning of 2026. Requires the service to be enabled on your Chronofresh contract.

For each method you can set the **title**, the **cost** and the **tax status** directly in the shipping zone.

---

## 5. Product setup

In every product page, **Shipping** tab:

| Field | Meaning |
|-------|---------|
| **Temperature type** | `Ambient`, `Fresh` or `Freeze` — drives the Chronopost product code on the label |
| **DLC (days before expiration)** | Fresh/Freeze only. If empty, the global default is used |

Notes:

- Products **without** a temperature type are treated as **Ambient** for label generation.
- The **DLC is mandatory** for Chronofresh: *"any parcel whose use-by date is missing or exceeded will not be delivered"*. The plugin always sends it, using the **minimum DLC** among the products of the parcel.
- The global default DLC lives under WooCommerce → ChronoFresh (45 days by default). Typical values: cured meat 5 days, frozen goods 90 days.

---

## 6. Checkout — pickup point selection

For the pickup point methods (`86`, `5Q`, `6S`):

1. the customer enters their shipping address;
2. the map appears under the shipping method with the **10 nearest points**;
3. clicking a point (map or list) shows its **opening hours** and selects it;
4. the order cannot be placed until a point is selected.

The pickup point search uses the product code of the selected method, so a **Fresh Relais (6S)** search only returns points that accept fresh parcels.

---

## 7. Daily workflow

1. An order arrives with a ChronoFresh method.
2. Open the order → **ChronoFresh Labels** box (right column) → **Generate labels**.
   Or select several orders in the list → Bulk actions → **Generate ChronoFresh labels**.
3. The PDF labels are generated and stored; the customer receives a **tracking email**.
4. If configured, the order status changes automatically (WooCommerce → ChronoFresh → auto status).
5. Print the label, stick it on the parcel, hand it to Chronopost before the daily deadline.
6. **Track** the parcel live from the order (Details button — no extra credentials needed).
7. Made a mistake? **Cancel** the label from the order (available ~10 minutes after generation, and until the parcel is scanned by Chronopost).

Mixed orders (ambient + fresh + freeze) are split automatically: **one label per temperature group**, and per weight limit (default 20 kg per parcel, configurable).

---

## 8. Troubleshooting

| Symptom | Fix |
|---------|-----|
| "PHP SOAP extension missing" notice | Ask your host to enable `php-soap` |
| Error 30 "Invalid contract number" | Check account number / password in the settings |
| Error 33 / rejected product code | The service (e.g. `6S`, `2R`) is not enabled on your Chronopost contract — contact your sales rep |
| Error 35 "Code Service GeoPost not found" | Product code not compatible with the destination — check the address is in metropolitan France |
| No pickup points found | Check postcode + city; try the standard Relais method to isolate a contract issue |
| Label without tracking number | Enable debug mode and read the XML files in `/wp-content/uploads/simple-connection-for-chronofresh-woocommerce/` |
| Cancellation error 3 | The parcel was already scanned by Chronopost — cancellation is no longer possible |

Debug logs: `/wp-content/uploads/simple-connection-for-chronofresh-woocommerce/scc-debug.log` (enable debug mode in the settings).

---

## 9. Support

- Built-in guide: WooCommerce → ChronoFresh → **Getting started** tab.
- WordPress.org support forum.
- Chronopost technical contacts: [clients.dv@chronopost.fr](mailto:clients.dv@chronopost.fr) / [clients.dcs@chronopost.fr](mailto:clients.dcs@chronopost.fr).
- Premium support: [tlloancy@deter-mi.net](mailto:tlloancy@deter-mi.net).
