Group Food Order Taker
A WordPress plugin for group food ordering integrated with WooCommerce. This plugin allows multiple guests at a single location to place a combined order for fixed 2-course or 3-course meal packages. Designed specifically for the TINKERSFIELD Dinner Menu system.
by Usama · github.com/usamakhan143/order-taker-plugin-for-woocommerce · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/usamakhan143/order-taker-plugin-for-woocommerce/archive/refs/heads/main.zipA WordPress plugin for group food ordering integrated with WooCommerce. This plugin allows multiple guests at a single location to place a combined order for fixed 2-course or 3-course meal packages. Designed specifically for the TINKERSFIELD Dinner Menu system.
Purpose
This plugin solves the problem of managing group food orders where multiple guests need to order together. Instead of individual item selection, guests choose from fixed meal packages (2-course or 3-course), making it easier for restaurants to manage group orders, calculate totals, and process kitchen requirements efficiently.
Key Features
Frontend Features
- Fixed Package System: Guests select either a 2-course ($65) or 3-course ($80) package instead of individual menu items
- Menu Display: Complete menu items are displayed upfront so guests know what's included in each package
- Dynamic Guest Management: Add or remove guests dynamically with smooth UI animations
- Real-time Price Calculation: Automatic price updates as guests are added/removed or packages are changed
- Food Selection: For 2-course packages, guests choose between "Starter + Main" or "Main + Dessert" combinations
- Individual Food Item Selection: Guests select specific starters, mains, and desserts from available menu items
- Collapsible Guest Sections: Each guest section can be collapsed/expanded to save screen space
- Responsive Design: Mobile-friendly interface that works on all devices
- Form Validation: Client-side validation ensures all required fields are filled before submission
Backend Features
- WooCommerce Integration: Seamlessly integrates with WooCommerce cart and checkout
- Order Management: Complete order details stored in WooCommerce order meta
- Kitchen Totals: Automatically calculates total count of each food item across all guests for kitchen preparation
- Admin Order Display: Custom admin interface showing detailed order breakdown
- HPOS Compatible: Supports WooCommerce High-Performance Order Storage (HPOS)
- Data Persistence: All order data (guests, selections, dietary requirements) permanently stored with orders
How It Works
Installation & Setup
-
Requirements:
- WordPress 5.8 or higher
- PHP 7.4 or higher
- WooCommerce 5.0 or higher (tested up to 8.0)
-
Activation:
- The plugin automatically checks for WooCommerce on activation
- If WooCommerce is not active, the plugin will not activate
- Default settings are automatically configured:
- 2-course price: $65.00
- 3-course price: $80.00
- Time slots: 6:00 PM - 7:00 PM, 7:00 PM - 8:00 PM, 8:00 PM - 9:00 PM
- Menu items: TINKERSFIELD Dinner Menu items
-
Usage:
- Add the shortcode
[group_food_order_form]to any page or post - The form will automatically load with all necessary assets
- Add the shortcode
Frontend User Flow
Step 1: Form Display
- User visits a page containing the
[group_food_order_form]shortcode - The form loads with the "TINKERSFIELD Dinner Menu" section visible
- Menu items are displayed in three categories: STARTERS, MAINS, and DESSERT
- Each menu item shows with a circular icon indicator
Step 2: Global Order Information
User fills in common order details that apply to all guests:
- Delivery Time Slot: Dropdown selection (e.g., 6:00 PM - 7:00 PM)
- Hut: Dropdown selection with options (Field Hut 1, Field Hut 2, Field Hut 3, Field Studio 1, Field Studio 2, Field Studio 3, Barn House, Barn, Post Office, Bastion)
- Dietary Requirements: Optional textarea for special instructions, allergies, vegetarian/vegan requirements, etc.
Step 3: Adding Guests
- By default, one guest section is automatically added
- User clicks "Add Guest" button to add more guests
- New guests are added with smooth slide-down animation
- Previous guest sections automatically collapse to save space
- User can remove guests (minimum one guest required)
- Each guest section can be individually collapsed/expanded
Step 4: Guest Order Details
For each guest, user provides:
- Guest Name: Optional text field
- Package Selection: Required dropdown - "2 Course Package - $65" or "3 Course Package - $80"
Step 5: Package Selection & Food Choices
For 2-Course Package:
- User must select combination: "Starter + Main Course" or "Main Course + Dessert"
- Based on combination selection:
- If "Starter + Main": User selects one starter and one main course
- If "Main + Dessert": User selects one main course and one dessert
- Dynamic description section shows selected combination details
For 3-Course Package:
- User must select: one starter, one main course, and one dessert
- All three selections are required
- Dynamic description section shows all three courses
Step 6: Real-time Price Calculation
- JavaScript automatically calculates total price based on:
- Number of 2-course packages × $65
- Number of 3-course packages × $80
- Price updates instantly when:
- Guests are added or removed
- Package selections are changed
- Price breakdown displayed:
- 2 Course Orders: count and subtotal
- 3 Course Orders: count and subtotal
- Total: Grand total amount
Step 7: Form Submission
- User clicks "Order Now" button
- Client-side validation ensures:
- Delivery time slot is selected
- Hut is selected
- All guests have valid package selections
- All required food items are selected for each guest
- If validation passes, form data is sent via AJAX to server
- Loading state is displayed during submission
Backend Processing Flow
Step 1: AJAX Request Handling
- Server receives AJAX request with form data
- Security verification: Nonce check to ensure legitimate request
- Server-side validation:
- Delivery time slot verification
- Hut/location verification
- Minimum one guest required
- Each guest has valid package selection
- Each guest has valid food item selections based on package type
Step 2: Data Sanitization & Validation
- All input data is sanitized and validated
- Guest data structure:
- Guest name (optional)
- Course type (2 or 3)
- Two-course combo (if applicable: "starter_main" or "main_dessert")
- Selected starter (if applicable)
- Selected main (always required)
- Selected dessert (if applicable)
- Menu item selections are validated against available menu items from settings
Step 3: Price Calculation (Server-side)
- Server calculates total price for security verification:
- Counts 2-course packages
- Counts 3-course packages
- Applies pricing from settings
- Calculates final total
Step 4: Kitchen Totals Calculation
- System calculates total count of each food item across all guests:
- Total count of each starter item
- Total count of each main item
- Total count of each dessert item
- This data is stored for kitchen preparation purposes
Step 5: WooCommerce Cart Integration
- System creates or retrieves a virtual product for group orders
- Cart is cleared (only one group order at a time)
- Order is added to WooCommerce cart with:
- Calculated total price
- All guest data (as JSON)
- Delivery time slot
- Location (Hut)
- Dietary notes
- Course counts (2-course and 3-course separately)
- Kitchen totals (item counts)
- Cart item displays as "Group Food Order (X guests)"
Step 6: Redirect to Checkout
- Upon successful cart addition, user is redirected to WooCommerce checkout page
- Standard WooCommerce checkout process begins
- User completes billing information and payment
Step 7: Order Creation & Data Storage
- When order is placed, WooCommerce creates the order
- All group food order data is saved as order meta:
_gfot_guests: JSON array of all guest data with food selections_gfot_delivery_time: Selected delivery time slot_gfot_location: Selected hut/location_gfot_dietary_notes: Dietary requirements/notes_gfot_two_course_count: Number of 2-course packages_gfot_three_course_count: Number of 3-course packages_gfot_kitchen_totals: JSON object with item counts
- Data is also stored in order item meta for redundancy
- All data is permanently attached to the order
Admin View Flow
Step 1: Order Access
- Admin navigates to WooCommerce → Orders in WordPress dashboard
- Opens any order that was created through the group food order form
Step 2: Order Identification
- System automatically detects if order is from this plugin
- Detection based on presence of
_gfot_guestsmeta data - If detected, custom admin interface is displayed
- Normal WooCommerce orders are unaffected
Step 3: Custom Order Information Display
Admin sees organized sections:
Order Information Section:
- Hut: Selected location/hut
- Delivery Time Slot: Selected time slot
- Dietary Requirements / Special Instructions: Any special notes
Course Summary Section:
- Total Guests: Total number of guests
- 2-Course Orders: Count of 2-course packages
- 3-Course Orders: Count of 3-course packages
- Pricing Breakdown:
- 2-course orders: quantity × $65 = subtotal
- 3-course orders: quantity × $80 = subtotal
- Grand Total: Complete order total
Guest Breakdown Section:
- Individual card for each guest showing:
- Guest number and name (if provided)
- Package type (2 Course or 3 Course)
- Selected food items:
- Starter (if selected) with menu item name
- Main course (always shown) with menu item name
- Dessert (if selected) with menu item name
- Package combination (for 2-course: "Starter + Main" or "Main + Dessert")
Kitchen Totals Section:
- Summary of all food items needed:
- Starters: List of each starter item with total count
- Mains: List of each main item with total count
- Desserts: List of each dessert item with total count
- Helps kitchen staff prepare correct quantities
Step 4: Default WooCommerce Elements
- Standard WooCommerce "Items" metabox is hidden for group food orders (custom display replaces it)
- All other WooCommerce features (billing, shipping, payment, order notes) work normally
- Order can be managed like any other WooCommerce order
Technical Architecture
File Structure
order-taker/
├── order-taker.php # Main plugin file
├── includes/
│ ├── class-order-taker.php # Main plugin class (singleton)
│ ├── class-frontend.php # Frontend form rendering & shortcode
│ ├── class-ajax.php # AJAX request handling
│ ├── class-woocommerce.php # WooCommerce integration
│ └── class-admin.php # Admin interface
├── templates/
│ └── order-form.php # Frontend form template
├── assets/
│ ├── css/
│ │ └── order-taker.css # Frontend styles
│ └── js/
│ └── order-taker.js # Frontend JavaScript
└── README.md
Core Classes
Group_Food_Order_Taker (Main Plugin Class)
- Singleton pattern
- Loads all dependencies
- Initializes all component classes
- Handles text domain loading
GFOT_Frontend
- Registers
[group_food_order_form]shortcode - Enqueues CSS and JavaScript assets
- Renders order form template
- Retrieves menu items from settings
GFOT_Ajax
- Handles
gfot_submit_orderAJAX action - Validates and sanitizes form data
- Calculates prices and kitchen totals
- Integrates with WooCommerce cart
GFOT_WooCommerce
- Creates/retrieves virtual product for orders
- Adds orders to cart with custom data
- Customizes cart item display
- Saves order meta data on checkout
- Handles cart session persistence
GFOT_Admin
- Detects group food orders
- Renders custom admin interface
- Displays order details in organized sections
- Supports both HPOS and traditional order storage
- Hides default WooCommerce items metabox for plugin orders
Data Storage
Settings (gfot_settings option):
two_course_price: Price for 2-course packagethree_course_price: Price for 3-course packagetime_slots: Array of available delivery time slotsmenu_items_starter: Array of starter menu itemsmenu_items_main: Array of main course menu itemsmenu_items_dessert: Array of dessert menu items
Order Meta Data:
_gfot_guests: JSON array of guest data with food selections_gfot_delivery_time: Delivery time slot_gfot_location: Location/hut_gfot_dietary_notes: Dietary requirements_gfot_two_course_count: Count of 2-course packages_gfot_three_course_count: Count of 3-course packages_gfot_kitchen_totals: JSON object with item counts
Virtual Product:
- A hidden WooCommerce product is created/used for all group orders
- Product ID stored in
gfot_virtual_product_idoption - Product is virtual, hidden from catalog, and sold individually
JavaScript Functionality
GFOT Object (Main JavaScript namespace):
init(): Initializes form and binds eventsaddGuest(): Dynamically adds new guest sectionremoveGuest(): Removes guest section (minimum one required)calculatePrice(): Real-time price calculationsubmitOrder(): Form validation and AJAX submissionupdateGuestNumbers(): Updates guest numbering after removal
Event Handlers:
- Package type change: Shows/hides relevant food selection fields
- Combo selection (2-course): Shows starter+main or main+dessert options
- Guest add/remove: Updates price and UI
- Form submission: Validates and submits via AJAX
Security Features
- Nonce Verification: All AJAX requests verified with WordPress nonces
- Input Sanitization: All user input sanitized before processing
- Output Escaping: All output properly escaped for display
- Capability Checks: Admin functions check user capabilities
- Data Validation: Both client-side and server-side validation
WooCommerce Compatibility
- HPOS Support: Compatible with WooCommerce High-Performance Order Storage
- Cart/Checkout Blocks: Declared compatible with cart/checkout blocks
- Order Meta: Uses WooCommerce order meta API for data storage
- Cart Session: Properly handles WooCommerce cart session data
- Virtual Products: Uses WooCommerce virtual product system
Default Configuration
Pricing
- 2-Course Package: $65.00
- 3-Course Package: $80.00
Time Slots
- 6:00 PM - 7:00 PM
- 7:00 PM - 8:00 PM
- 8:00 PM - 9:00 PM
Menu Items
Starters:
- Oak Smoked Snowy Mts Trout, Apple, Celery, Radish & Buckwheat
- Spanish Ham, Pear, Fresh Mozzarella & Basil Salad
- Asparagus, Avocado, Almonds, Brown Rice, Soft Poached Hens Egg
Mains:
- Black Angus NY Strip Loin, Roast Shallot & Field Mushroom
- Citrus Salted Duck Leg Confit, Broccolini & Garden Peas
- Monaro Lamb Shoulder "cooked low & slow", Lemon, Spinach & Feta
Desserts:
- Lindt Chocolate Brownies
- Gin Bathed Fruits & Sorbet
- Baby Dessert Jars
- Lemon Meringue Pie
- Oreo Cookie Cheese Cake
Location Options
- Field Hut 1
- Field Hut 2
- Field Hut 3
- Field Studio 1
- Field Studio 2
- Field Studio 3
- Barn House
- Barn
- Post Office
- Bastion
Developer Information
Developer: Usama
Website: http://github.com/usamakhan143
License
This plugin is provided as-is for use in your WordPress installation.
Changelog
Version 1.0.0
- Initial release
- Group food ordering system with WooCommerce integration
- Fixed 2-course and 3-course package system
- Individual food item selection
- Kitchen totals calculation
- Custom admin order display
- HPOS compatibility
- Responsive frontend design