=== FreightMaster Shipping for WooCommerce ===
Contributors: freightmaster
Tags: shipping, pallet, freight, woocommerce, france
Requires at least: 6.5
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

Pallet shipping price at checkout from the FreightMaster API, "quote on request" when the cart cannot be quoted, booking from the order screen.

== Description ==

This extension connects a WooCommerce store to the FreightMaster API (freightmaster.fr), an API for pallet shipping (messagerie palettisée) in France and between France and 35 European countries.

* At checkout, the cart is turned into pallets and a real quote is asked. The shipping cost is the FreightMaster price excluding VAT (plus your adjustment, if any); WooCommerce applies your tax settings.
* When the cart cannot be quoted (outside the pallet network limits, no offer on this route, no answer in time), the customer sees "quote on request".
* On the order screen, a "FreightMaster" box lets the shop manager check the pallets, book, get the label, cancel and follow the tracking.
* Events (label, tracking, status) are read every 5 minutes with WP-Cron. No webhook to open.

You need a FreightMaster customer account. A test key (fm_test_…) is created freely in the customer portal, "API" menu: real quotes, simulated bookings. Real bookings need a production key, for monthly-invoiced accounts, after your agency has reviewed a test booking. A card-paying account can quote; it cannot book through the API (the order screen gives a link to book on the portal).

= Cart → pallets =

Each product says how many units fit on one pallet (Product data → Shipping → "Units per pallet"). Each product line makes full pallets, then one pallet for the rest. Pallet weight = units × product weight + empty pallet weight (setting, 25 kg by default). A product without weight gives "quote on request", never a zero weight. Pallet format and loaded height come from the product, else from the store settings. Optionally, several products of the same pallet format can share pallets (fractions added up).

= Limits =

* 6 pallets and 2.4 loading meters per shipment, 220 cm high, 1,500 kg per pallet. Each carrier has its own ceilings; the API answer decides.
* The label is not instant: your agency issues it after the booking, without guaranteed delay; sometimes there is none.
* The pickup date is a requested date, at the earliest the next working day, not guaranteed.
* Prices are those of your FreightMaster account. A quote is guaranteed 24 h for an identical shipment.

= External service =

This extension sends data to FreightMaster (https://freightmaster.fr), only after you tick the consent box in the settings: delivery postal code and country, pallet details, and, when you book, sender and consignee addresses (company, contact, phone, email). Terms: https://freightmaster.fr/api/conditions — privacy: https://freightmaster.fr/confidentialite

== Installation ==

1. WordPress → Plugins → Add New → Upload Plugin, choose freightmaster-shipping-woocommerce.zip, activate.
2. WooCommerce → Settings → Shipping → FreightMaster: tick the consent, paste the test key, fill in the sender (pickup address), save. The screen says what the key can do.
3. WooCommerce → Settings → Shipping → a shipping zone → Add shipping method → FreightMaster (pallet shipping).
4. For each product: weight, and "Units per pallet" in Product data → Shipping.

== Frequently Asked Questions ==

= Does the customer see several carriers? =

No: the cheapest bookable offer among the allowed carriers is shown. The shop manager sees the carrier on the order.

= What happens if FreightMaster does not answer in time at checkout? =

The customer sees "quote on request" after the waiting time set in the settings (5 seconds by default), and the order can still be placed.

= Is a booking sent twice if I click twice? =

No. Each booking request is saved on the order before it is sent, with an idempotency key made of the order and the attempt number. If the answer is lost, the next click sends the same request again and FreightMaster returns the same shipment.

== Changelog ==

= 1.0.0 =
* First version.
