=== Travel Booking for Duffel ===
Contributors: alexcolombo
Tags: flights, flight search, travel agency, duffel, travel
Requires at least: 6.0
Tested up to: 7.1
Stable tag: 1.1.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live flight search for travel agency websites, powered by your own Duffel account. Results, full flight details, and a contact button.

== Description ==

Travel Booking for Duffel adds a live flight search to your WordPress site. Visitors search real flights and current prices from your own [Duffel](https://duffel.com/) account, compare results, and open any flight to see the full itinerary, baggage, and fare rules. When they find the right one, a contact button sends them straight to you.

It is built for travel agencies, tour operators, and the people who build their websites.

= What the free plugin does =

* Live airport and city suggestions
* Live flight search: one way or round trip, adults, children, and infants, all cabin classes
* Results with airline logos, both legs of a round trip, stops, and sorting by price, duration, or departure time
* A full flight page: every segment and layover, baggage allowance, and change and refund rules
* A contact button on the flight page that goes to your email, phone, or any page you choose
* Test mode and live mode, with a connection check
* Sample flights before you connect Duffel, clearly labelled, so you can design your pages first
* Shortcode and block, theme-friendly styling, and a brand color setting
* Spanish translation included (all Spanish locales)

Your Duffel API token stays on your server. Visitors never see it.

= TravelBookingWP Pro =

Pro adds the tools that turn searches into customers:

* Flight request form on the flight page: requests are emailed to you, saved in WordPress, and the visitor gets a confirmation
* Your agency fee added to the prices visitors see, as a fixed amount or a percentage; requests show you the fare and your fee separately
* "Send on WhatsApp" button with the route, dates, and price filled in
* Search analytics, custom CSS, and administrator test orders
* Business plan: five sites, priority support, and your brand name in the admin menu

Pro is a separate plugin you install alongside or instead of this one; your settings carry over. Learn more at [travelbookingwp.com](https://travelbookingwp.com/).

= What it does not do =

The plugin does not take payments or issue tickets. Visitors see live flights and contact you; you confirm and book through your usual process.

= Requirements =

* WordPress 6.0 or higher and PHP 7.4 or higher
* A Duffel account and API token for live search (free to create a test token)
* HTTPS on your site

= External Services =

This plugin connects to one external service.

**Duffel API** (https://api.duffel.com), only after you save a Duffel API token. When a visitor types in the airport field or searches, the plugin sends the search to Duffel from your server: the typed airport or city text, origin and destination, travel dates, cabin class, and the number and type of passengers. When a visitor opens a flight, the plugin asks Duffel for that offer's current details. No visitor names, emails, or payment details are sent to Duffel by the free plugin. Airline logos in the results are images served by Duffel.

* Duffel terms: https://duffel.com/terms
* Duffel privacy policy: https://duffel.com/privacy-policy

The optional "Flight search by TravelBookingWP" credit under the search form is off by default and only appears if you turn it on.

Travel Booking for Duffel is not affiliated with or endorsed by Duffel.

== Installation ==

1. In WordPress, go to **Plugins > Add New Plugin**, search for "Travel Booking for Duffel", then install and activate it.
2. Follow the setup wizard, or add `[duffel_flight_search]` to a page (or use the Flight Search block).
3. Create a test token in your Duffel dashboard and paste it under **Travel Booking > Settings**, then click **Test Connection**.
4. Search on your page. When everything looks right, add your live token and switch to Live Mode.
5. Optional: set up the contact button under **Settings > Contact Button**.

== Frequently Asked Questions ==

= Is the flight search really live in the free plugin? =

Yes. Once you add your Duffel API token, visitors see real flights and current prices from your Duffel account. Before that, the plugin shows clearly labelled sample flights.

= Does it cost anything to use Duffel? =

Creating a Duffel account and searching in test mode is free. Check Duffel's current pricing for live use and bookings: https://duffel.com/pricing

= Can visitors pay or book on my site? =

No. The plugin shows live flights and sends visitors to you. You confirm availability and book through your usual process.

= Does the plugin include a Duffel account or airline accreditation? =

No. You are responsible for your Duffel account, eligibility, and any commercial agreements with Duffel.

= Is it available in Spanish? =

Yes. The visitor search and the admin screens are translated for all Spanish locales.

= Can I change how it looks? =

Yes. It uses your theme's font, adapts to phones, and has a brand color setting. Pro adds custom CSS.

= Are hotels included? =

Not yet. The plugin covers flights.

== Screenshots ==

1. Flight search form
2. Airport and city suggestions
3. Flight results with sorting
4. Flight page with itinerary, baggage, and fare rules
5. Setup wizard
6. Connection settings
7. Appearance settings
8. Flight request form (Pro)

== Changelog ==

= 1.1.0 =

* Live Duffel flight search, results, and the full flight page are now free with your own Duffel token
* New: contact button on the flight page (email, phone, or a page link)
* New in Pro: agency fee added to displayed prices, shown to you separately in flight requests
* New in Pro: "Send on WhatsApp" button on the flight page
* The "Powered by" credit is now off by default and optional
* Business white label now shows your brand name in the admin menu
* Plugin folder and text domain renamed to travel-booking-for-duffel for WordPress.org

= 1.0.1 =

* New: visitors can request a flight from the offer page. Requests are emailed to you, saved under Travel Booking > Flight Requests, and the visitor gets a confirmation email
* New: the offer page shows the full itinerary, layovers, flight numbers, baggage and fare rules
* New: results show airline logos, both legs of a round trip, and can be sorted by price, duration or departure time
* New: Spanish translation for the visitor search and the admin screens
* Upgrading from the free plugin to the paid plugin now works in one step (the free plugin is switched off automatically, and your settings are kept)
* Live results show correct departure and arrival times, with a next-day marker
* Premium Economy searches work
* Clearer search form messages and keyboard-friendly airport suggestions
* The search widget uses your theme's font and adapts properly on phones
* Search keeps working on cached pages; per-visitor search limit protects your Duffel account
* Removed sample flights from the Search Results and Offer Details pages; they now show a clear empty state
* Search assets load with page builders, widgets, and block templates
* Starter custom CSS is applied on the site
* Paying customers no longer see upgrade prompts; expired licenses see a renewal notice
* Fixed the Orders menu error, duplicate menu items, and the health-check button
* Visitor IP addresses in analytics are anonymized

= 1.0.0 =

* Initial sale-readiness release
* Responsive demonstration flight search
* Paid Duffel place suggestions and flight search
* Current-offer refresh and server-authoritative test-order data
* Operating-carrier disclosure
* Test-mode order validation for supported adult itineraries
* Admin setup, connection checks, appearance controls, and scoped packaging

== Upgrade Notice ==

= 1.1.0 =

Live flight search is now free with your own Duffel token. Pro adds agency fees and a WhatsApp button.

= 1.0.1 =

Adds visitor flight requests, a detailed offer page, and Spanish; fixes the upgrade from the free plugin, live result times, and Premium Economy searches.

= 1.0.0 =

The paid version connects TravelBookingWP to your own Duffel account for live flight search and supported test-mode integration checks.
