✈️
🌍
🎫
💳
📄
⭐ WordPress Plugin v2.2.0

Flight Ticket Sale

A comprehensive WordPress + WooCommerce plugin for flight search, booking, and ticket sales. Integrates with 6 major flight APIs plus local database flights with intelligent pricing, PDF tickets, and agent system.

✈️ 6 APIs + Database 🎨 3 Search Layouts 📄 PDF Tickets 👥 Agent System 💰 Smart Pricing 🚀 Auto Setup

📑 Table of Contents

🚀 Getting Started

  • • System Requirements
  • • Installation
  • • Auto Setup NEW
  • • WooCommerce Setup

🎨 Search Form Layouts NEW

  • • Classic Layout
  • • Google Flights Style
  • • Modern Minimal
  • • Layout Selection

✈️ Flight Management

  • • Database Flights
  • • One-Way vs Return Pricing
  • • API Integration
  • • Search Results

🎫 Booking System

  • • Booking Flow
  • • Passenger Details
  • • Payment Processing
  • • PDF Ticket Generation

👥 Agent System

  • • Agent Registration
  • • Wallet System
  • • Discounts
  • • Agent Dashboard

⚙️ Configuration

  • • General Settings
  • • API Settings
  • • Auto-Created Resources
  • • Currency & Date Format

🔧 Advanced

  • • Troubleshooting
  • • Debug Mode
  • • Hooks & Filters
  • • FAQ

🚀 Auto Setup Feature NEW in v2.1.1

Plugin automatically creates all required pages and WooCommerce product on activation!

Zero Configuration Required! When you activate the plugin, it automatically creates all required pages with correct shortcodes and a WooCommerce product. You can start using the plugin immediately!

📄 Auto-Created Pages

  • Flight Results - /flight-results/
    Contains [flight_results] shortcode

  • Flight Booking - /flight-booking/
    Contains [flight_booking] shortcode

  • Booking Confirmation - /booking-confirmation/
    Contains [flight_booking_confirmation] shortcode

🛒 Auto-Created WooCommerce Product

  • Product Name: "Flight Ticket"

  • SKU: flight-ticket-sale

  • Type: Simple, Virtual (no shipping)

  • Visibility: Hidden from catalog

  • Price: Set dynamically by plugin

🔄 Recreate Missing Resources

If you accidentally delete any auto-created pages or the WooCommerce product, you can easily recreate them:

  1. Go to Flight Ticket → Settings
  2. Scroll to "Auto-Created Resources" section
  3. View status of all resources (Created ✓ or Missing ✗)
  4. Click "Recreate Missing Resources" button
  5. Go to Settings → Permalinks and click "Save Changes"
💡

Activation Notice: After activating the plugin, you'll see a success notice with direct links to edit each created page and the WooCommerce product.

🎨 Search Form Layouts NEW in v2.2.0

Choose from 3 beautiful, modern search form designs that won't conflict with your theme

Theme-Safe Design! All layouts use unique CSS prefixes (fts-classic-, fts-google-, fts-m-) to prevent conflicts with themes and other plugins. Each layout is fully responsive and includes all search features.

📋 Classic Layout Default

Original grid-based design with clean lines. Great for traditional booking sites.

Grid Layout Blue Theme Icon Labels

🔵 Google Flights Style NEW

Round trip
One way

Inspired by Google Flights with card-based design and tab selectors.

Card Design Tab Pills Inline Swap

🟣 Modern Minimal NEW

Round trip
One way

Sleek design with gradient accents and floating labels.

Gradient Floating Labels Shimmer

🔧 How to Change Layout

  1. Go to Flight Ticket → Settings
  2. Scroll to "Search Form Layout" section in General tab
  3. Click on any layout preview card to select it
  4. Click "Save Settings"
  5. Your search form will now use the new layout!

📊 Layout Features Comparison

Feature Classic Google Flights Modern Minimal
Trip Type Selector Radio buttons Tab pills Toggle switch
Location Fields Stacked with icons Inline with centered swap Grid with floating labels
Swap Button Between fields Centered circle Side positioned
Class Dropdown Simple select Custom with icons Custom with gradient
Search Button Solid rectangle Pill shape Gradient with shimmer
Mobile Responsive ✓ Yes ✓ Yes ✓ Yes
🎨

Custom Class Dropdown: The Google Flights and Modern Minimal layouts feature enhanced cabin class dropdowns with icons, descriptions, and visual selection indicators!

System Requirements

Minimum requirements to run the plugin

📦

WordPress

5.8+
🛒

WooCommerce

5.0+
🐘

PHP

7.4+
🗄️

MySQL

5.7+
🔒

SSL

Required
🌐

cURL

Enabled
📝

Memory

128MB+
⏱️

Max Execution

60s+
ℹ️

PHP Extensions Required:

  • cURL - For API requests
  • JSON - For API data parsing
  • GD or Imagick - For PDF generation
  • mbstring - For multi-byte string handling
  • OpenSSL - For secure API communication

📦 Installation Guide

Get started in minutes with automatic setup

1️⃣ Install Plugin

  • 1

    Go to Plugins → Add New

  • 2

    Click "Upload Plugin"

  • 3

    Select flight-ticket-sale.zip

  • 4

    Click "Install Now" then "Activate"

🚀 Automatic Setup AUTO

  • Pages Created: Flight Results, Flight Booking, Booking Confirmation

  • Product Created: WooCommerce "Flight Ticket" product

  • Settings Linked: Page IDs and Product ID auto-saved

  • Database Tables: All tables created automatically

2️⃣ After Activation

  • 1

    Go to Settings → Permalinks

  • 2

    Click "Save Changes" (flush permalinks)

  • 3

    Go to Flight Ticket → Settings

  • 4

    Configure your API credentials (if using external APIs)

3️⃣ Add Search Form

  • 1

    Create or edit your homepage (or any page)

  • 2

    Add shortcode: [flight_search]

  • 3

    Done! Users can now search and book flights

Flight Data Sources

Multiple sources for comprehensive flight coverage

🗄️

Database

Local Flights
🔵

Amadeus

GDS Provider
🟣

Duffel

Modern API
🟢

Kiwi.com

Tequila API
🔷

Skyscanner

Meta Search
🔴

Sabre

GDS Provider
🔹

Travelport

Galileo/Apollo

API Testing Status: Amadeus, Duffel, and Kiwi.com have been fully tested. Travelport, Sabre, and Skyscanner implementations are complete but require API access for testing.

🗄️ Database Flights Pricing System

Understanding One-Way vs Return pricing for local database flights

💡

Key Concept: When adding flights to the database, you choose between "One-Way" and "Return" pricing types. This affects how prices are displayed and which search results show the flight.

➡️ One-Way Flight Type

  • 1

    Standalone pricing - Full price for single leg

  • 2

    Shown in One-Way searches

  • 3

    Can be combined for Round-Trip searches

  • 4

    Higher price (e.g., €200)

  • 5

    Customer can buy just this flight

🔄 Return Flight Type

  • 1

    Discounted pricing - Requires both legs

  • 2

    NOT shown in One-Way searches

  • 3

    Only shown in Round-Trip searches

  • 4

    Lower price per leg (e.g., €150)

  • 5

    Customer must buy both outbound + return

📊 Pricing Example: Paris (CDG) ↔ Barcelona (BCN)

Flight Type Date One-Way Price Return Price
CDG → BCN One-Way Return 20 Dec 2025 €200 €150
BCN → CDG One-Way Return 22 Dec 2025 €200 €150
🔍 One-Way Search Result

CDG → BCN (20 Dec)

€200

Only One-Way type shown

🔍 Round-Trip (Return Pricing)

CDG ↔ BCN (20-22 Dec)

€300

€150 + €150 = Best deal!

🔍 Round-Trip (One-Way Combo)

CDG ↔ BCN (20-22 Dec)

€400

€200 + €200 = Combined

🚫

Why Return-type flights are NOT shown in One-Way searches:

  • Return price (€150) is a discounted round-trip price
  • Customer must buy BOTH legs to get this price
  • Showing €150 for one-way would be misleading
  • One-way travelers should see one-way pricing (€200)

🔍 Search Results Features

Smart features to help customers find the best flights

🏷️

Smart Badges

Cheapest - Lowest price option
Fastest - Shortest duration
Best Value - Price/duration ratio
Direct - Non-stop flight

🔀

Sorting Options

Price: Low to High / High to Low
Duration: Shortest / Longest
Departure: Earliest / Latest
Results update instantly without page reload

🎛️

Filter Options

Price Range: Min/Max slider
Stops: Direct, 1 stop, 2+ stops
Time: Morning, Afternoon, Evening, Night
Airlines: Select specific carriers
Source: Filter by API provider

📋

Flight Details

Click "Details" button to expand
Shows: Baggage allowance, aircraft type, amenities, fare rules, layover info
AJAX loaded - No page refresh needed

🎨

Source Color Coding

Each API has unique color for easy identification:
Database | Amadeus | Duffel
Kiwi | Skyscanner | Sabre

📱

Mobile Responsive

Fully responsive design
Mobile filter sidebar with toggle
Touch-friendly controls
Optimized card layout for small screens

📄 PDF Ticket Generation

Automatic e-ticket generation and delivery

🎫 What's Included in PDF

  • Booking Reference (PNR) - Unique booking ID

  • Flight Details - Number, airline, route, times

  • Passenger Information - Names, passport details

  • Baggage Allowance - Checked and cabin

  • Price Breakdown - Per passenger and total

  • QR Code - For quick verification

  • Terms & Conditions - Fare rules

📥 How to Download PDF

  • 1

    Booking Confirmation Page - Auto-download link after payment

  • 2

    Email Attachment - PDF attached to confirmation email

  • 3

    WooCommerce Order - Download from order details page

  • 4

    Admin Panel - Bookings → View → Download PDF

  • 5

    Agent Dashboard - Agents can download their bookings

⚙️ PDF Generation Settings

File Location:

/wp-content/uploads/flight-tickets/

File Naming:

ticket-{order_id}-{booking_ref}.pdf

Library Used:

TCPDF (included with plugin)

Auto-Cleanup:

Old PDFs deleted after 30 days

// Programmatically generate PDF
$pdf_url = flight_ticket_sale_generate_pdf($order_id);

// Hook to customize PDF content
add_filter('fts_pdf_content', 'my_custom_pdf', 10, 2);

📧 Email Notifications

Automatic email notifications for bookings

📤 Customer Emails

  • Booking confirmation with PDF
  • Payment received notification
  • Booking status updates
  • Flight reminder (24h before)
  • Cancellation confirmation

📥 Admin Emails

  • New booking notification
  • Payment received alert
  • Booking failure alert
  • Low seat availability warning
  • Daily booking summary (optional)

👥 Agent Emails

  • Booking confirmation
  • Wallet deduction notice
  • Low wallet balance warning
  • Commission earned (if enabled)

⚙️ Email Settings

  • Custom email templates
  • HTML or plain text format
  • Custom sender name/email
  • Enable/disable per notification
  • PDF attachment toggle

📝 Email Template Variables

{booking_ref} - Booking reference
{customer_name} - Customer name
{flight_details} - Flight info
{passenger_list} - All passengers
{total_price} - Total amount
{departure_date} - Departure date
{pdf_link} - PDF download link
{site_name} - Website name

Booking Workflow

Complete customer journey from search to e-ticket

🔍

1. Search

Enter route, dates, passengers

📋

2. Results

Compare flights, filter, sort

3. Select

Choose flight, click Book

👥

4. Passengers

Enter all passenger details

💳

5. Payment

WooCommerce checkout

🎫

6. Confirmation

PNR & PDF ticket

👥 Passenger Details Form

Information collected for each passenger

🧑

Adults (12+ years)

Required: Title, First Name, Last Name, DOB, Gender, Nationality
Passport: Number, Expiry Date, Issuing Country
Contact: Email, Phone (at least one adult)

👧

Children (2-11 years)

Required: Title, First Name, Last Name, DOB, Gender
Passport: Number, Expiry Date, Issuing Country
Age Validation: Must be under 12 on departure date

👶

Infants (Under 2)

Required: First Name, Last Name, DOB, Gender
Passport: Number, Expiry Date (for international)
Age Validation: Must be under 2 on departure date

📝 Form Validation Features

  • Real-time validation - Errors shown instantly as user types
  • Passport expiry check - Must be valid 6 months after return date
  • Age category validation - DOB must match passenger type (adult/child/infant)
  • Name format - Must match passport exactly (as per IATA standards)
  • Phone validation - Country code + number format check
  • Email verification - Valid email format required
  • Duplicate detection - Warns if same passenger added twice

📋 Booking Statuses

Understanding order statuses throughout the booking lifecycle

Pending Payment

Customer selected flight but payment not completed. Reservation not confirmed with airline. Session expires in 30 minutes.

🔄

Processing

Payment received. Creating booking with airline API. PNR being generated. Usually completes in seconds.

Completed

Booking confirmed with airline. PNR assigned. PDF generated. Customer receives confirmation email.

Failed

Booking could not be completed. Reasons: sold out, API error, payment declined. Customer should be refunded.

🚫

Cancelled

Booking cancelled by admin or customer. Cancellation processed with airline if applicable.

💰

Refunded

Full or partial refund processed. Refund amount recorded. Original booking marked for reference.

🛒 WooCommerce Integration

Seamless integration with WooCommerce for payments and orders

🚀

Auto Setup: The WooCommerce product is now created automatically when you activate the plugin! No manual product creation needed.

📦 Auto-Created Product AUTO

  • Name: "Flight Ticket"

  • SKU: flight-ticket-sale

  • Price: $0 (set dynamically)

  • Type: Simple, Virtual

  • Visibility: Hidden from catalog

💳 Supported Payment Gateways

  • Stripe - Credit/Debit cards

  • PayPal - Standard & Express

  • Bank Transfer - Manual processing

  • Agent Wallet - Built-in prepaid

  • Any WooCommerce Gateway

📊 Order Meta Data Stored

_flight_booking_ref

PNR/Booking Reference

_flight_details

Flight info (serialized)

_passenger_details

All passenger data

_flight_api_source

database/amadeus/duffel/etc

_flight_total_price

Calculated total

_agent_discount

Agent discount applied

HPOS Compatible: This plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS). Works with both legacy post-based and new custom tables order storage.

👥 Agent System

Complete B2B system for travel agents

👤 Agent Registration

  • Admin creates agent account
  • Assign "flight_ticket_agent" role
  • Set discount percentage (0-100%)
  • Initialize wallet balance
  • Set credit limit (optional)
  • Agent receives login credentials

💰 Wallet System

  • Pre-paid wallet balance
  • Admin adds funds manually
  • Deducted on successful booking
  • Full transaction history
  • Low balance email alerts
  • WooCommerce payment gateway

📊 Agent Dashboard

  • View total bookings
  • Check wallet balance
  • Recent bookings list
  • Revenue statistics
  • Download booking PDFs
  • Transaction history

🏷️ Agent Discounts

  • Percentage-based discount
  • Applied at checkout automatically
  • Visible in order review
  • Per-agent customization
  • Discount shown on invoice
  • Commission tracking

🔗 Agent Shortcodes

[agent_login]

Login form for agents

[agent_dashboard]

Main dashboard with stats

[agent_bookings]

List of agent's bookings

[agent_wallet_history]

Wallet transaction history

🔌 API Setup Guide

Configure each flight API provider

🔵 Amadeus GDS

Industry-leading GDS with test environment.
  1. Register at developers.amadeus.com
  2. Create application, get API Key & Secret
  3. Choose environment (Test/Production)
  4. Enter credentials in plugin settings
  5. Set markup percentage
  6. Test connection
Test: test.api.amadeus.com
Live: api.amadeus.com

🟣 Duffel Modern

Modern API with excellent documentation.
  1. Sign up at duffel.com
  2. Create organization
  3. Get Access Token
  4. Select environment (Test/Live)
  5. Enter token in settings
  6. Test connection
API: api.duffel.com/air

🟢 Kiwi.com B2B

Requires B2B partner status for booking.
  1. Apply at partners.kiwi.com
  2. Get Tequila API access
  3. Obtain API Key
  4. Set Affiliate ID
  5. Enable booking API
  6. Configure settings
API: tequila-api.kiwi.com

🔷 Skyscanner Meta

Meta-search - redirects to partners for booking.
  1. Register at partners.skyscanner.net
  2. Apply for API access
  3. Get API Key
  4. Note: Redirects to partner sites
  5. Enter key in settings
API: partners.api.skyscanner.net

🔴 Sabre GDS

Requires agency agreement.
  1. Contact Sabre for access
  2. Complete agency certification
  3. Get Client ID & Secret
  4. Obtain PCC code
  5. Enter credentials
api.platform.sabre.com

🔹 Travelport GDS

Galileo, Apollo, Worldspan systems.
  1. Apply at developer.travelport.com
  2. Choose GDS system
  3. Get credentials & Target Branch
  4. Obtain Provider Code
  5. Configure settings
Galileo: 1G | Apollo: 1V

⚙️ Settings Reference

Complete configuration options

⚙️

General Settings

Currency: Default currency (EUR, USD, etc.)
Flight Product ID: Auto-created WooCommerce product
Results Page: Auto-created page
Booking Page: Auto-created page
Confirmation Page: Auto-created page

🔄

Auto-Created Resources NEW

View Status: See all auto-created items
Page IDs: Shows page IDs for each
Edit Links: Quick access to edit pages
Recreate: Button to recreate missing resources

🔌

API Settings (Per Provider)

Enable/Disable: Toggle API on/off
Environment: Test or Production
Credentials: API keys and secrets
Price Markup: Percentage to add
Result Color: Visual identification
Timeout: API request timeout

📧

Email Settings

Admin Email: Notification recipient
From Name: Sender display name
From Email: Sender email address
Attach PDF: Include ticket in emails
Email Templates: Customizable templates

👥

Agent Settings

Enable Agents: Turn on agent system
Default Discount: New agent discount
Wallet Enable: Use wallet system
Min Balance Alert: Low balance threshold
Allow Credit: Negative balance allowed

🔒

Security Settings

Session Duration: Booking session timeout
Nonce Expiry: Form security
Rate Limiting: API request limits
Logging: Debug log enable/disable

🔍 Flight Search Form Features

All search form capabilities

🛫

Origin & Destination

AJAX Search: Type to search airports
Display Format: City - Airport Name (CODE)
Swap Button: Click to swap origin/destination
Select2: Enhanced dropdown with search
Only enabled locations are shown

📅

Date Selection

Flatpickr: Modern date picker
Min Date: Today (no past dates)
Return Date: Auto-disabled for one-way
Date Format: Configurable in settings
Auto-adjust: Return date after departure

👥

Passengers

Adults: 1-9 passengers (12+ years)
Children: 0-9 passengers (2-11 years)
Infants: 0-9 passengers (under 2)
Validation: Infants ≤ Adults
Max Total: 9 passengers

✈️

Trip Type & Class

One-Way: Single direction flight
Round-Trip: Outbound + return flights
Economy: Standard class
Premium Economy: Enhanced comfort
Business / First: Premium classes

💡

Modify Search: After viewing results, customers can modify search parameters. The form pre-fills with previous search values (origin, destination, dates, passengers, class).

📊 Admin Panel

Comprehensive management interface

📊 Dashboard

  • Total bookings count
  • Revenue statistics
  • Recent bookings list
  • API status indicators
  • Quick action buttons
  • Charts & graphs

📋 Bookings

  • View all bookings
  • Filter by status/date/agent
  • View booking details
  • Edit passenger info
  • Download PDF tickets
  • Change booking status
  • Process refunds

✈️ Manage Flights

  • View all database flights
  • Quick status toggle
  • Edit flight details
  • Duplicate flights
  • Bulk actions
  • Filter by route/date

➕ Add Flight

  • AJAX airport search
  • Flight number autocomplete
  • Live preview card
  • Auto-calculate duration
  • One-Way/Return pricing
  • Class-based pricing

🏢 Airlines

  • View all airlines
  • Enable/disable airlines
  • Manage logos
  • Manage flight numbers
  • Search & filter
  • Bulk status updates

📍 Locations

  • Manage airports
  • Enable/disable locations
  • Search by code/name/city
  • Bulk enable/disable
  • Import airport data

👥 Agents

  • Create agent accounts
  • Set discounts
  • Manage wallet balance
  • Add/deduct funds
  • View agent bookings
  • Transaction history

⚙️ Settings

  • General configuration
  • API credentials
  • Price markup
  • Auto-created resources status
  • Recreate missing pages
  • Import/Export data

📝 Shortcodes Reference

All available shortcodes

Public Shortcodes:

[flight_search] // Search form + redirects to results page
[flight_results] // Display search results (auto-created page)
[flight_booking] // Passenger details form (auto-created page)
[flight_booking_confirmation] // Booking confirmation (auto-created page)

Agent Shortcodes:

[agent_login] // Agent login form
[agent_dashboard] // Agent dashboard with stats
[agent_bookings] // Agent's booking list
[agent_wallet_history] // Wallet transactions

📄 Required Pages Setup

🚀

Auto-Created: Pages marked with ✅ AUTO are automatically created when you activate the plugin. No manual setup required!

Page Shortcode Slug Auto-Created
Search Page [flight_search] Your choice (e.g., homepage) Manual
Results Page [flight_results] /flight-results/ ✅ AUTO
Booking Page [flight_booking] /flight-booking/ ✅ AUTO
Confirmation Page [flight_booking_confirmation] /booking-confirmation/ ✅ AUTO
Agent Login [agent_login] Your choice Manual (optional)
Agent Dashboard [agent_dashboard] Your choice Manual (optional)

🔧 Hooks & Filters

For developers to extend functionality

// Modify search results before display
add_filter('fts_search_results', 'my_custom_results', 10, 2);

// Add custom fields to booking form
add_action('fts_after_passenger_fields', 'my_custom_fields');

// Modify PDF content before generation
add_filter('fts_pdf_content', 'my_custom_pdf', 10, 2);

// After booking completed
add_action('fts_booking_completed', 'my_after_booking', 10, 2);

// Modify email content
add_filter('fts_email_content', 'my_custom_email', 10, 3);

// Custom price calculation
add_filter('fts_calculate_price', 'my_custom_price', 10, 4);

// Before API search
add_action('fts_before_api_search', 'my_before_search');

// Agent discount calculation
add_filter('fts_agent_discount', 'my_custom_discount', 10, 3);

🔧 Troubleshooting Guide

Common issues and solutions

ℹ️ Pages not found after activation

404 error on auto-created pages

Solution: Go to Settings → Permalinks and click "Save Changes" to flush rewrite rules. This is required after plugin activation.

❌ Return flights not in one-way search

This is expected behavior!

Explanation: Return-type flights have discounted round-trip pricing. Customers must buy both legs. One-way searches only show One-Way type flights.

❌ PDF not generating

PDF ticket fails to create

Solution: 1) Check PHP memory limit (128MB+). 2) Verify /wp-content/uploads/ is writable. 3) Enable WP_DEBUG to see errors. 4) Check TCPDF library loaded.

⚠️ API returns no results

Search returns empty

Solution: 1) Check API credentials. 2) Verify locations enabled. 3) Check date is future. 4) Test connection in settings. 5) Enable debug mode.

⚠️ Email not sending

Customer not receiving emails

Solution: 1) Check spam folder. 2) Use SMTP plugin. 3) Verify email settings. 4) Check WooCommerce email settings. 5) Test with WP Mail logging plugin.

ℹ️ Price shows as $0

Flight prices displaying zero

Solution: 1) Check WooCommerce product exists (auto-created). 2) Verify Product ID in settings. 3) For database flights, check prices set. 4) Check currency settings.

❌ "Offer not found" on booking

Error completing booking

Solution: API flight offers expire (15-30 mins). Customer needs to search again. Database flights don't expire.

⚠️ Agent discount not applying

Full price at checkout

Solution: 1) Verify agent logged in. 2) Check agent has correct role. 3) Confirm discount percentage set. 4) Check wallet balance if using wallet.

🐛 Debug Mode

Troubleshoot issues with logging

// Add to wp-config.php

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

📝 What Gets Logged

  • API request URLs
  • Request parameters
  • Response codes (200, 400, 405)
  • Error messages
  • Booking attempts
  • PDF generation errors

📂 Log Location

  • Path: /wp-content/debug.log
  • Access via FTP or File Manager
  • Search for "Flight Ticket Sale"
  • Or search by API name
⚠️

Security: Always disable debug mode on production! Debug logs may contain sensitive API information. Delete debug.log regularly.

🗄️ Database Structure

Custom tables created by the plugin

wp_flight_ticket_sale_flights

Database flights with One-Way/Return pricing, schedules, capacity, and status.

wp_flight_ticket_sale_airlines

Airlines with codes, names, logos, flight numbers, status.

wp_flight_ticket_sale_locations

Airports with IATA/ICAO codes, city, country, coordinates.

wp_passenger_flight_assignments

Passenger to flight assignments for bookings.

wp_flight_ticket_sale_wallet

Agent wallet balances for prepaid booking system.

wp_flight_ticket_sale_wallet_history

Transaction history for wallet credits/debits.

📁 File Structure

Plugin directory organization

flight-ticket-sale/ ├── flight-ticket-sale.php // Main plugin file ├── ajax-handlers.php // AJAX handlers ├── generate-booking-pdf.php // PDF generation ├── deactive-uninstall.php // Cleanup on uninstall ├── includes/ │ ├── class-flight-ticket-sale-activator.php // Auto-create pages/product │ ├── class-flight-ticket-sale-db.php // Database operations │ ├── class-flight-ticket-sale-woocommerce.php // WC integration │ ├── class-flight-ticket-sale-wallet.php // Wallet system │ ├── class-flight-ticket-sale-agent.php // Agent system │ ├── class-flight-ticket-sale-passenger-validator.php │ ├── class-flight-ticket-sale-hpos-compat.php // HPOS support │ ├── class-flight-ticket-sale-amadeus-api.php │ ├── class-flight-ticket-sale-duffel-api.php │ ├── class-flight-ticket-sale-kiwi-api.php │ ├── class-flight-ticket-sale-skyscanner-api.php │ ├── class-flight-ticket-sale-sabre-api.php │ ├── class-flight-ticket-sale-travelport-api.php │ └── class-flight-ticket-sale-api-interface.php ├── admin/ │ ├── partials/ │ │ ├── admin-dashboard.php │ │ ├── admin-bookings-page.php │ │ ├── admin-view-booking.php │ │ ├── admin-edit-booking.php │ │ ├── manage-flights.php │ │ ├── add-flight.php │ │ ├── flight-details.php │ │ ├── manage-airlines.php │ │ ├── manage-locations.php │ │ ├── manage-agents.php │ │ └── settings.php // Includes auto-resources section │ ├── css/ │ └── js/ └── public/ ├── partials/ │ ├── flight-search-form.php │ ├── flight-results.php │ ├── flight-booking-form.php │ ├── booking-confirmation.php │ ├── agent-login-form.php │ ├── agent-dashboard.php │ ├── agent-bookings.php │ └── agent-wallet-history.php ├── css/ └── js/

📋 Changelog

Version history and updates

v2.2.0 (January 2026) LATEST

  • 🎨 NEW: 3 Search Form Layouts - Classic, Google Flights Style, Modern Minimal
  • 🎨 NEW: Visual layout selector in Settings with preview cards
  • 🎨 NEW: Enhanced cabin class dropdown with icons and descriptions
  • 🎨 NEW: Date range highlighting between departure and return
  • 🎨 NEW: Auto-flow navigation (origin → destination → dates)
  • 🔧 All layouts use unique CSS prefixes to prevent theme conflicts
  • 🔧 Each layout is fully responsive and mobile-friendly
  • 🔧 Improved passenger dropdown with better styling

v2.1.1 (December 2025)

  • 🚀 NEW: Auto-create pages on activation (Flight Results, Flight Booking, Booking Confirmation)
  • 🚀 NEW: Auto-create WooCommerce "Flight Ticket" product on activation
  • 🚀 NEW: "Recreate Missing Resources" button in Settings
  • 🚀 NEW: Activation notice with links to all created resources
  • 🚀 NEW: Auto-Created Resources status section in Settings
  • 🔧 Fixed: Sabre API passenger type building optimization
  • 🔧 Fixed: Skyscanner API cabin class format (CABIN_CLASS_ECONOMY)
  • 🔧 Fixed: Settings page URL in activation notice
  • 🗑️ Removed: Unnecessary Custom Post Type registration (Flights menu)

v2.1.0 (December 2025)

  • ✨ New: Intelligent One-Way/Return pricing for database flights
  • ✨ New: AJAX airport search in Add Flight page
  • ✨ New: Flight number autocomplete by airline
  • ✨ New: Same Airline / Mixed Airline badges for round-trips
  • ✨ New: Manage Flight Numbers feature for airlines
  • 🔧 Fixed: Round-trip search now properly pairs Return-type flights
  • 🔧 Fixed: One-way search excludes Return-type flights
  • 🎨 Improved: Modern admin UI design system

v2.0.0 (November 2025)

  • ✨ New: Multi-API support (6 providers)
  • ✨ New: Agent system with wallet
  • ✨ New: PDF ticket generation
  • ✨ New: Smart badges (Cheapest, Fastest, Best Value)
  • ✨ New: Advanced filtering and sorting
  • ✨ New: HPOS compatibility
  • 🎨 Complete UI redesign

⚡ Quick Reference

Common URLs and paths

// Admin Menu URLs Dashboard: admin.php?page=flight-ticket-sale Bookings: admin.php?page=flight-ticket-sale-bookings Flights: admin.php?page=flight-ticket-sale-flights Add Flight: admin.php?page=flight-ticket-sale-add-flight Airlines: admin.php?page=flight-ticket-sale-airlines Locations: admin.php?page=flight-ticket-sale-locations Agents: admin.php?page=flight-ticket-sale-agents Settings: admin.php?page=flight-ticket-sale-settings // Auto-Created Page Slugs Results: /flight-results/ Booking: /flight-booking/ Confirmation: /booking-confirmation/ // PDF Download URL admin-post.php?action=download_pdf&order_id={ORDER_ID} // AJAX Endpoints (via admin-ajax.php) action=fts_search_airports // Airport search action=fts_get_flight_numbers // Flight numbers by airline action=fts_add_flight // Save new flight action=fts_toggle_status // Toggle flight/airline status action=flight_ticket_sale_recreate_resources // Recreate pages/product // Database Table Names (wp_ prefix varies) wp_flight_ticket_sale_flights wp_flight_ticket_sale_airlines wp_flight_ticket_sale_locations wp_passenger_flight_assignments wp_flight_ticket_sale_wallet wp_flight_ticket_sale_wallet_history // Option Names (in wp_options) flight_ticket_sale_currency flight_ticket_sale_results_page // Auto-created page ID flight_ticket_sale_booking_page // Auto-created page ID flight_ticket_sale_confirmation_page // Auto-created page ID flight_ticket_product_id // Auto-created product ID flight_ticket_sale_{api}_api_status flight_ticket_sale_{api}_price_markup

❓ Frequently Asked Questions

Q: How do I change the search form layout?

Go to Flight Ticket → Settings and scroll to the "Search Form Layout" section. Click on any layout preview card to select it, then click "Save Settings". The change takes effect immediately on your frontend.

Q: Will the new layouts conflict with my theme?

No! All layouts use unique CSS prefixes (fts-classic-, fts-google-, fts-m-) specifically to prevent conflicts with themes and other plugins. Each layout is self-contained with scoped styles.

Q: Do I need to manually create pages for the plugin?

No! As of v2.1.1, all required pages (Flight Results, Flight Booking, Booking Confirmation) and the WooCommerce product are automatically created when you activate the plugin. You only need to add the [flight_search] shortcode to your desired search page (e.g., homepage).

Q: What if I accidentally delete an auto-created page?

Go to Flight Ticket → Settings and scroll to the "Auto-Created Resources" section. Click the "Recreate Missing Resources" button to recreate any missing pages or the WooCommerce product. Don't forget to flush permalinks afterward (Settings → Permalinks → Save Changes).

Q: Do I need all 6 flight APIs?

No. You can use just database flights, or configure only the APIs you need. Even one API is enough to start.

Q: Can I test without real bookings?

Yes! Amadeus and Duffel offer test/sandbox environments. Set "Environment" to "Test" in settings. Database flights are always safe to test.

Q: Why does WooCommerce product need $0 price?

The plugin dynamically sets the actual flight price when adding to cart. The base $0 gets overridden with the real flight cost including any markup.

Q: How long do flight offers remain valid?

API flight offers typically expire within 15-30 minutes. Database flights don't expire. If an offer expires, customer needs to search again.

Q: What payment methods are supported?

Any WooCommerce payment gateway! Stripe, PayPal, bank transfers, etc. Plus the built-in Agent Wallet for B2B transactions.

Q: Can I use this with page builders?

Yes! Shortcodes work with Elementor, WPBakery, Divi, Gutenberg, and others. Just add a shortcode widget/block.

Q: Why are Return-type flights not showing in one-way search?

Return prices are discounted round-trip fares requiring purchase of both legs. Showing them for one-way would be misleading. One-way searches show only One-Way type flights at full price.

Q: Is the plugin HPOS compatible?

Yes! The plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS). It works with both legacy post-based storage and the new custom tables order storage system.

Q: Why do I get 404 errors on the auto-created pages?

After activating the plugin, you need to flush the permalinks. Go to Settings → Permalinks and click "Save Changes". This refreshes WordPress's rewrite rules.

Need Help?

Get support and stay updated with the latest features

📧 Contact Support 📖 Documentation 💬 Community Forum

Flight Ticket Sale Plugin v2.2.0 | Developed by Nasir Mehmood

Compatible with WordPress 5.8+ | WooCommerce 5.0+ | PHP 7.4+

© 2026 All Rights Reserved

Flight Ticket Sale Logo
Flight Ticket Sale