niainteractive / digitaltickets
OctoberCMS Mall plugin extension for class bookings with date selection and virtual tickets
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:october-plugin
Requires
- php: >=7.4
- october/rain: ~3.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
This plugin extends the OctoberCMS Mall plugin to handle class bookings with date selection functionality.
Prerequisites
Important: This plugin requires the Mall plugin for OctoberCMS to be installed first.
Install Mall Plugin First
-
Install the Mall plugin via OctoberCMS backend:
- Go to Settings > Updates & Plugins
- Search for "Mall"
- Install the "Mall" plugin by Offline
-
Or install via Composer (if available):
composer require offline/mall
Installation
Option 1: Via Composer (Recommended)
composer require niainteractive/digitaltickets
Option 2: Manual Installation
-
Copy the plugin files to your OctoberCMS plugins directory:
plugins/niainteractive/digitaltickets/
-
Register the plugin in your
config/cms.php
:'plugins' => [ 'Niainteractive\Digitaltickets\Plugin' ]
-
Run the database migration:
php artisan october:up
Configuration
Setting up Class Booking Products
- Go to your OctoberCMS backend
- Navigate to Mall > Products
- Edit a product you want to make a class booking
- Enable the "Is Class Booking" switch
- Enter available dates in the "Available Dates" field (comma-separated)
Example:
2024-01-15, 2024-01-22, 2024-01-29
Using the Component
Add the ClassBooking component to your product page:
[classBooking] productId = "{{ product.id }}" == <div id="class-booking-container"> {% component 'classBooking' %} </div>
Email Template
The plugin includes a pre-configured email template that sends:
- Customer name
- Class name
- Selected class date
- Amount paid
- Unique ticket ID
- Order number
The email template is located at: plugins/niainteractive/digitaltickets/views/mail/confirmation.htm
Database Changes
The plugin adds the following fields to Mall tables:
mall_products
is_class_booking
(boolean) - Whether the product is a class bookingavailable_dates
(text) - Comma-separated list of available dates
mall_orders
booking_date
(string) - The selected booking date
mall_order_items
booking_date
(string) - The selected booking date for this item
Usage Flow
- Customer selects a class product
- Date picker appears (if product is marked as class booking)
- Customer selects available date
- Product is added to cart with selected date
- Checkout process continues normally
- Confirmation email is sent with virtual ticket
Customization
Styling the Date Picker
The component includes basic CSS styling. You can customize it by modifying the styles in components/classbooking/default.htm
.
Email Template Customization
Edit the email template at views/mail/confirmation.htm
to match your branding and requirements.
Adding More Fields
To add additional fields to the booking process:
- Extend the database migration
- Add fields to the component form
- Update the email template
- Modify the cart/order processing logic
Troubleshooting
Email Not Sending
- Check your OctoberCMS mail configuration
- Verify the order completion event is firing
- Check server logs for mail errors
Date Selection Not Working
- Ensure the product has
is_class_booking
set to true - Verify available dates are properly formatted
- Check browser console for JavaScript errors
Database Issues
- Run
php artisan october:up
to ensure migrations are applied - Check database permissions
- Verify table structure matches expected schema
Mall Plugin Not Found
- Ensure Mall plugin is installed before installing this plugin
- Check that Mall plugin is properly registered in your OctoberCMS installation
Support
For issues and questions, please check:
- OctoberCMS documentation
- Mall plugin documentation
- Server error logs
- Browser developer tools
License
This plugin is provided as-is for educational and commercial use. # digitaltickets