Trip Package Sale - WordPress Plugin Documentation
🌍
đŸī¸
📅
đŸ‘Ĩ
📄
⭐ WordPress Plugin v1.2.0

Trip Package Sale

A comprehensive WordPress + WooCommerce plugin for travel package booking and sales. Features destination management, trip scheduling, passenger details collection, PDF confirmations, and a complete agent/reseller system with wallet payments.

🚀 Auto Setup 🌍 Multi-Destination 📅 Trip Scheduling đŸ‘Ĩ Agent System 💰 Wallet Payments 📄 PDF Confirmations

📑 Table of Contents

🚀 Getting Started

  • â€ĸ System Requirements
  • â€ĸ Auto Setup NEW
  • â€ĸ Installation
  • â€ĸ WooCommerce Setup

đŸī¸ Trip Management

  • â€ĸ Destinations
  • â€ĸ Categories
  • â€ĸ Trip Packages
  • â€ĸ Trip Dates & Scheduling

📋 Booking System

  • â€ĸ Booking Flow
  • â€ĸ Passenger Details
  • â€ĸ Payment Processing
  • â€ĸ PDF Confirmation

đŸ‘Ĩ Agent System

  • â€ĸ Agent Registration
  • â€ĸ Wallet System
  • â€ĸ Discounts
  • â€ĸ Agent Dashboard

âš™ī¸ Configuration

  • â€ĸ General Settings
  • â€ĸ Auto-Created Resources NEW
  • â€ĸ Email Settings
  • â€ĸ Page Assignments

🔧 Advanced

  • â€ĸ Shortcodes
  • â€ĸ Hooks & Filters
  • â€ĸ Troubleshooting
  • â€ĸ FAQ

🚀 Auto Setup Feature

Zero configuration required - everything is created automatically on activation!

✨

New in v1.2.0: When you activate the plugin, all required pages and the WooCommerce product are created automatically. No manual setup needed!

📄 Auto-Created Pages

  • Trip Listing - /trip-listing/
  • Trip Details - /trip-details/
  • Trip Booking - /trip-booking/
  • Booking Confirmation - /trip-booking-confirmation/

🛒 Auto-Created Product

  • Name: Trip Package
  • SKU: trip-package-sale
  • Type: Virtual, Sold Individually
  • Visibility: Hidden from catalog
  • Price: $0 (set dynamically)

🔧 Recreate Resources

  • Go to Trip Packages → Settings
  • View resource status in General tab
  • Click "Recreate Missing Resources"
  • Missing pages/product will be recreated
  • Existing resources are preserved

đŸ“ĸ Activation Notice

  • Shows all created resources
  • Direct links to edit each page
  • Link to edit WooCommerce product
  • Reminder to flush permalinks
  • Link to plugin settings

System Requirements

Minimum requirements to run the plugin

đŸ“Ļ

WordPress

5.8+
🛒

WooCommerce

5.0+
🐘

PHP

7.4+
đŸ—„ī¸

MySQL

5.7+
🔒

SSL

Recommended
📝

Memory

128MB+
â„šī¸

PHP Extensions Required:

  • GD or Imagick - For PDF generation
  • mbstring - For multi-byte string handling
  • JSON - For data processing

Core Features

Everything you need for travel package sales

🚀

Auto Setup

All required pages and WooCommerce product are created automatically on activation. Zero manual configuration needed to get started.

🌍

Destination Management

Create and manage travel destinations with images, descriptions, countries, and featured status. Organize trips by location for easy browsing.

📁

Trip Categories

Organize trips into categories like Adventure, Beach, Cultural, Family, etc. Each category can have its own image and description.

đŸī¸

Trip Packages

Create detailed trip packages with itineraries, inclusions, exclusions, duration, pricing for adults/children/infants, and photo galleries.

📅

Trip Scheduling

Set multiple departure dates for each trip with individual pricing, availability tracking, and seat limits per date.

đŸ‘Ĩ

Passenger Management

Collect detailed passenger information including passport details, dietary requirements, special requests, and emergency contacts.

📄

PDF Confirmations

Automatic PDF booking confirmation generation with trip details, passenger list, payment summary, and important travel information.

đŸ’ŗ

WooCommerce Integration

Seamless checkout with all WooCommerce payment gateways. Full HPOS compatibility for modern order storage.

⭐

Reviews & Ratings

Customer review system for trips with star ratings. Display average ratings on trip cards and detail pages.

Installation Guide

Get up and running in minutes

đŸ“Ļ Step 1: Install Plugin

  • 1

    Upload plugin to /wp-content/plugins/

  • 2

    Activate via Plugins → Installed Plugins

  • 3

    Plugin creates database tables automatically

🚀 Step 2: Automatic Setup AUTO

  • ✓

    Trip Listing page created automatically

  • ✓

    Trip Details page created automatically

  • ✓

    Trip Booking page created automatically

  • ✓

    Booking Confirmation page created automatically

  • ✓

    WooCommerce product created automatically

  • ✓

    Settings linked automatically

âš™ī¸ Step 3: After Activation

  • 1

    Go to Settings → Permalinks and click Save Changes (flushes rewrite rules)

  • 2

    Navigate to Trip Packages → Settings to configure options

  • 3

    Start creating destinations, categories, and trips!

🔍 Step 4: Add Search Form

  • 1

    Create a page or use homepage

  • 2

    Add shortcode: [trip_search]

  • 3

    Optional: Add [trip_featured] for featured trips

  • 4

    Optional: Add [trip_destinations] for destinations grid

✅

That's it! With auto-setup, you no longer need to manually create pages or the WooCommerce product. The plugin handles everything on activation!

📄 Auto-Created Pages Reference

Page Slug Shortcode Status
Trip Listing /trip-listing/ [trip_listing] AUTO
Trip Details /trip-details/ [trip_details] AUTO
Trip Booking /trip-booking/ [trip_booking] AUTO
Booking Confirmation /trip-booking-confirmation/ [trip_booking_confirmation] AUTO
Trip Search Your choice [trip_search] Manual

đŸī¸ Trip Management

Creating and managing travel packages

🌍 Destinations

  • ✓

    Name & Country - Location identification

  • ✓

    Description - Detailed destination info

  • ✓

    Featured Image - Destination cover photo

  • ✓

    Featured Status - Highlight on homepage

  • ✓

    Trip Count - Auto-calculated trips

📁 Categories

  • ✓

    Category Name - Adventure, Beach, etc.

  • ✓

    Description - Category overview

  • ✓

    Category Image - Visual representation

  • ✓

    Status - Active/Inactive toggle

  • ✓

    Trip Count - Trips in category

âœˆī¸ Trip Package Fields

Basic Information
  • Trip Title
  • Short Description
  • Full Description (WYSIWYG)
  • Destination & Category
  • Featured Image & Gallery
Duration & Departure
  • Days / Nights
  • Departure Location
  • Departure Time
  • Multiple Departure Dates
Pricing
  • Adult Price
  • Child Price
  • Infant Price
  • Discount Price (optional)
Details
  • Itinerary (day-by-day)
  • What's Included
  • What's Excluded
  • Important Notes

Booking Workflow

Complete customer journey from search to confirmation

🔍

1. Search

Browse destinations, categories, or search trips

đŸī¸

2. Select Trip

View details, itinerary, photos

📅

3. Choose Date

Select departure date & passengers

đŸ‘Ĩ

4. Passengers

Enter all passenger details

đŸ’ŗ

5. Payment

WooCommerce checkout

✅

6. Confirmation

Booking ref & PDF download

đŸ‘Ĩ Passenger Details Form

Information collected for each traveler

🧑

Adults

Required: Title, First Name, Last Name, Date of Birth, Gender, Nationality
Passport: Number, Expiry Date, Issuing Country
Contact: Email, Phone (lead passenger)

👧

Children

Required: Title, First Name, Last Name, Date of Birth, Gender
Passport: Number, Expiry Date
Age: Must match child age range

đŸ‘ļ

Infants

Required: First Name, Last Name, Date of Birth, Gender
Passport: Number, Expiry Date (international)
Note: Must be under 2 on departure

📝 Form Validation Features

  • Real-time validation - Errors shown instantly as user types
  • Passport expiry check - Must be valid 6 months after return
  • Age validation - DOB must match passenger type
  • Name format - Must match passport (as per requirements)
  • Phone validation - International format check
  • Email verification - Valid email format required

📄 PDF Booking Confirmation

Automatic confirmation document generation

đŸŽĢ What's Included in PDF

  • ✓

    Booking Reference - Unique booking ID (TRP-XXXXX)

  • ✓

    Trip Details - Name, destination, dates, duration

  • ✓

    Passenger List - All travelers with details

  • ✓

    Itinerary - Day-by-day schedule

  • ✓

    Payment Summary - Price breakdown & total

  • ✓

    Important Information - Travel notes

đŸ“Ĩ How to Download PDF

  • 1

    Confirmation Page - After payment completion

  • 2

    Email Attachment - PDF attached to confirmation email

  • 3

    WooCommerce Order - My Account → Orders → View

  • 4

    Admin Panel - Bookings → View → Download

  • 5

    Agent Dashboard - Agent's booking list

🛒 WooCommerce Integration

Seamless payment processing

🚀

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

đŸ›ī¸

Auto-Created Product AUTO

Name: Trip Package
SKU: trip-package-sale
Type: Virtual, Sold Individually
Visibility: Hidden from catalog

đŸ’ŗ

Payment Gateways

Supported: All WooCommerce gateways
Stripe, PayPal, Bank Transfer, Agent Wallet
Full HPOS compatibility

đŸ“Ļ

Order Integration

Trip details saved to order meta
Booking displayed in order details
PDF download from order page

✅

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

đŸ‘Ĩ Agent/Reseller System

Complete B2B system for travel agents

👤 Agent Registration

  • Admin creates agent accounts
  • Assign "trip_package_agent" role
  • Set discount percentage (0-100%)
  • Initialize wallet balance
  • 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

📊 Agent Dashboard

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

đŸˇī¸ Agent Discounts

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

📊 Admin Panel

Comprehensive management interface

📊 Dashboard

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

📋 Bookings

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

đŸī¸ Manage Trips

  • View all trips
  • Add new trips
  • Edit trip details
  • Manage dates
  • Set pricing
  • Status toggle

🌍 Destinations

  • Add destinations
  • Upload images
  • Set countries
  • Featured toggle
  • Trip count display

📁 Categories

  • Create categories
  • Category images
  • Descriptions
  • Status management

đŸ‘Ĩ Agents

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

⭐ Reviews

  • Moderate reviews
  • Approve/reject
  • View ratings
  • Edit reviews

âš™ī¸ Settings NEW

  • General config
  • Auto-Created Resources
  • Page assignments
  • Email settings
  • Recreate resources button

📝 Shortcodes Reference

All available shortcodes

🚀

Auto-Created Pages: Shortcodes marked with AUTO are automatically placed in their respective pages on plugin activation.

Display Shortcodes:

[trip_search] // Search form with filters
[trip_listing] // Trip listing with pagination ← AUTO
[trip_details] // Single trip details page ← AUTO
[trip_featured] // Featured trips grid
[trip_destinations] // Destinations grid
[trip_categories] // Categories grid

Booking Shortcodes:

[trip_booking] // Passenger details booking form ← AUTO
[trip_booking_confirmation] // Booking confirmation page ← AUTO

Agent Shortcodes:

[trip_agent_dashboard] // Agent dashboard with stats
[trip_agent_bookings] // Agent's booking list
[trip_agent_wallet_history] // Wallet transactions

Shortcode Parameters:

[trip_featured limit="6" columns="3"]
[trip_destinations limit="8" columns="4" featured="1"]
[trip_categories limit="6" columns="3"]
[trip_listing destination="5" category="3" limit="12"]

đŸ—„ī¸ Database Structure

Custom tables created by the plugin

wp_trip_package_sale_trips

Trip packages with details, pricing, duration, and settings

wp_trip_package_sale_trip_dates

Departure dates with availability and date-specific pricing

wp_trip_package_sale_destinations

Travel destinations with images, countries, and featured status

wp_trip_package_sale_categories

Trip categories for organization

wp_trip_package_sale_bookings

Booking records with status, totals, and customer info

wp_trip_package_sale_passengers

Passenger details linked to bookings

wp_trip_package_sale_reviews

Customer reviews and ratings for trips

wp_trip_package_sale_itineraries

Day-by-day itinerary for each trip

wp_trip_package_sale_faqs

Frequently asked questions for trips

wp_trip_package_sale_wallet

Agent wallet balances

wp_trip_package_sale_wallet_history

Wallet transaction history

📁 File Structure

Plugin directory organization

trip-package-sale/ ├── trip-package-sale.php // Main plugin file ├── includes/ │ ├── class-trip-package-sale-activator.php // Activation + Auto-create pages/product │ ├── class-trip-package-sale-deactivator.php // Deactivation │ ├── class-trip-package-sale-db.php // Database operations │ ├── class-trip-package-sale-woocommerce.php // WC integration │ ├── class-trip-package-sale-wallet.php // Wallet system │ ├── class-trip-package-sale-agent.php // Agent system │ ├── class-trip-package-sale-emails.php // Email notifications │ ├── class-trip-package-sale-shortcodes.php // Shortcodes │ ├── class-trip-package-sale-public.php // Public functions │ ├── class-trip-package-sale-admin.php // Admin functions │ ├── class-trip-package-sale-passenger-validator.php │ ├── ajax-handlers.php // AJAX handlers │ └── generate-booking-pdf.php // PDF generation ├── admin/ │ ├── css/ │ │ └── trip-package-sale-admin.css │ ├── js/ │ │ └── trip-package-sale-admin.js │ └── partials/ │ ├── admin-dashboard.php │ ├── admin-bookings.php │ ├── admin-view-booking.php │ ├── admin-edit-booking.php │ ├── manage-trips.php │ ├── add-trip.php │ ├── edit-trip.php │ ├── manage-destinations.php │ ├── manage-categories.php │ ├── manage-agents.php │ ├── manage-reviews.php │ └── settings.php // Includes auto-resources section └── public/ ├── css/ │ └── trip-package-sale-public.css ├── js/ │ └── trip-package-sale-public.js └── partials/ ├── trip-search-form.php ├── trip-listing.php ├── trip-details.php ├── trip-featured.php ├── trip-destinations.php ├── trip-categories.php ├── trip-booking-form.php ├── booking-confirmation.php ├── agent-dashboard.php ├── agent-bookings.php └── agent-wallet-history.php

🔧 Troubleshooting Guide

Common issues and solutions

❌ Pages not found (404) after activation

Auto-created pages return 404 error

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

❌ Shortcodes showing blank

Shortcode displays nothing on page

Solution: Check file paths in shortcodes class match actual template files. Verify templates exist in public/partials/ folder.

❌ PDF not generating

PDF download fails

Solution: 1) Check PHP memory (128MB+). 2) Verify /wp-content/uploads/ is writable. 3) Check GD/Imagick extension installed.

âš ī¸ Booking not created

Order completes but no booking

Solution: 1) Check WooCommerce product ID in settings. 2) Verify trip session data exists. 3) Check debug.log for errors.

âš ī¸ Agent discount not applying

Full price shown at checkout

Solution: 1) Verify agent is logged in. 2) Check agent has correct role. 3) Confirm discount percentage is set.

â„šī¸ Auto-created page missing

One or more pages weren't created

Solution: Go to Trip Packages → Settings → General and click "Recreate Missing Resources" button.

❓ Frequently Asked Questions

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

No! Starting with v1.2.0, all required pages (Trip Listing, Trip Details, Trip Booking, Booking Confirmation) are created automatically when you activate the plugin. The WooCommerce product is also created automatically.

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

Go to Trip Packages → Settings → General and click the "Recreate Missing Resources" button. The plugin will recreate any missing pages or the WooCommerce product.

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 tells WordPress to recognize the new page URLs.

Q: Can I have multiple departure dates for one trip?

Yes! Each trip can have unlimited departure dates. Each date can have its own pricing and availability settings.

Q: How does the agent wallet work?

Admin adds funds to agent wallets. When an agent books, the amount is deducted from their wallet. Agents can view their balance and transaction history in their dashboard.

Q: Can I customize the PDF design?

Yes, you can modify the generate-booking-pdf.php template file to customize the PDF layout, colors, and content.

Q: What payment methods are supported?

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

Q: Is the plugin translation-ready?

Yes! All strings use WordPress i18n functions. You can translate using any standard WordPress translation plugin or .po/.mo files.

📋 Changelog

Version history

v1.2.0 (December 2025) LATEST

  • 🚀 NEW: Auto-create pages on activation (Trip Listing, Details, Booking, Confirmation)
  • 🚀 NEW: Auto-create WooCommerce 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
  • ✨ Settings page IDs automatically linked on activation
  • 🔧 Improved activation process with better error handling

v1.1.0 (December 2025)

  • ✨ New: Modern responsive design for all frontend pages
  • ✨ New: WooCommerce Thank You page integration
  • ✨ New: My Account → View Order booking display
  • ✨ New: Updated booking confirmation page design
  • ✨ New: Fixed shortcode display issues
  • 🎨 Improved: Mobile-first responsive layouts
  • 🎨 Improved: Card-based design system
  • 🔧 Fixed: Template file path references

v1.0.0 (November 2025)

  • ✨ Initial release
  • ✨ Trip management system
  • ✨ Booking system with passenger details
  • ✨ Agent/reseller system with wallet
  • ✨ WooCommerce integration
  • ✨ PDF confirmation generation
  • ✨ Email notifications

Need Help?

Get support and stay updated with the latest features

📧 Contact Support 📖 Documentation đŸ’Ŧ Community Forum

Trip Package Sale Plugin v1.2.0 | Developed by Nasir Mehmood

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

Š 2025 All Rights Reserved