Scroll to top
Documentation

PS Hotel Booking

PS hotel booking Wordpress plugin Documentation

Introduction

Overview

The PS Hotel Booking plugin is a comprehensive solution designed to simplify hotel management directly from your WordPress admin panel. It allows hotel administrators and managers to efficiently manage hotels, rooms, and bookings, as well as communicate with customers and streamline operations. Whether you're running a single hotel or managing multiple properties, this plugin is tailored to meet your needs with flexibility and ease of use.

 

Key Features
  • Hotel and Room Management: Add, edit, and manage hotels, rooms, room types, and services with intuitive admin panels.
  • Booking System: Create, manage, and track customer bookings with a streamlined interface.
  • Role-Based Access Control: Assign specific roles to hotel managers, restricting access to their respective properties and data.
  • Customizable Notifications: Enable email notifications for hotel managers when new bookings are made.
  • Calendar View: Visualize bookings with an interactive calendar for better scheduling and management.
  • Shortcodes: Use powerful and flexible shortcodes to integrate booking forms and room listings into your website.
  • Developer Friendly: Leverage hooks, filters, and APIs to customize the plugin to your needs.
 
System Requirements

To ensure the plugin functions correctly, please verify that your system meets the following requirements:

  • WordPress Version: 5.6 or higher
  • PHP Version: 7.4 or higher (PHP 8.0+ recommended)
  • MySQL Version: 5.7 or higher (or MariaDB 10.3+)
  • Web Server: Apache or NGINX with mod_rewrite enabled

With these requirements in place, the PS Hotel Booking plugin provides a powerful and user-friendly solution for your hotel management needs.


Installation

Download the Plugin
  • Log in to your CodeCanyon account.
  • Navigate to the "Downloads" section.
  • Locate the PS Hotel Booking plugin and click on the "Download" button.
  • Select "Installable WordPress file only" to download the ps_hotel_booking.zip file.

 

Upload the Plugin
  • Log in to your WordPress admin dashboard.
  • Navigate to Plugins > Add New.
  • Click the "Upload Plugin" button at the top of the screen.
  • Choose the ps_hotel_booking.zip file you downloaded.
  • Click "Install Now."

 

Activate the Plugin
  • Once the upload completes, click the "Activate Plugin" button.

 

Verify Installation
  • After activation, a new menu item called Hotel Booking should appear in your WordPress admin dashboard.
  • Navigate to Hotel Booking > Settings to configure the plugin.

 

Troubleshooting
  • If you encounter issues during installation, ensure that your WordPress and PHP versions meet the requirements.
  • Check file upload limits in your hosting environment if the zip file fails to upload.
  • Contact support if you experience any unexpected errors.

Configuration

After installing the PS Hotel Booking plugin, you can customize its behavior and appearance to suit your needs. To access the configuration options, navigate to Hotel Booking > Settings in the WordPress admin panel. The settings are divided into three tabs: General Settings, Payment Settings, and Appearance Settings.

 

General Settings

general settings.png

he General Settings tab allows you to configure the core functionality of the plugin. Below are the options available:

  • Booking Notification Email: Enter the email address where you want to receive notifications about new bookings.
  • Booking Notification for Managers: Enable this option to notify hotel managers via email when a new booking is created.
  • Google API Key: Provide your Google API key to enable location-based features such as autocomplete for addresses. You can obtain an API key from the Google Cloud Console.
  • Enable Bookings for Guests: Enable or disable the ability for non-logged-in users to make bookings.
  • Booking Calendar Available Days: Set the number of active days shown in the booking calendar.
  • Disable Dates for These Booking Statuses: Choose which booking statuses will make the dates unavailable in the calendar.
  • Minimum Booking Days: Set the minimum number of consecutive days a room can be booked..
  • Maximum Booking Days: Set the maximum number of consecutive days a room can be booked.

 

Payment Settings

payment_settings.png

The Payment Settings tab allows you to enable or disable online payment functionality.

  • Enable Online Payments: Check this box to allow customers to pay for their bookings online. When enabled, payment integration will rely on your chosen payment gateways configured in your WordPress or WooCommerce settings.
  • Payment flow
    • Direct Payment flow: (No Cart), After booking, the user is immediately redirected to the WooCommerce payment selection page. Suitable for quick single-room bookings.
    • Full payment flow: The booking is added to the cart, where the user can proceed to checkout, enter billing details, and apply coupons/discounts. Ideal for multiple room bookings or additional payment customization.

 

Appearance Settings

appearance_settings.png

The Appearance Settings tab provides options to customize the front-end design of the plugin.

  • Container Width: Set the width of the container for hotel and room listings, e.g., 1280px.
  • Price Symbol: Specify the currency symbol to display for room prices, e.g., USD or $.
  • Primary Color: Choose the primary color for links, buttons, and other key elements.
  • Secondary Color: Select the secondary color used for hover effects and accents.
  • Hotels Listing Style: Choose the layout style for the hotel listing page. Options include Grid, List or Theme based.
  • Rooms Listing Style: Choose the layout style for the room listing page. Options include Grid, List or Theme based.

By configuring these settings, you can tailor the PS Hotel Booking plugin to meet your specific requirements and provide a seamless booking experience for your users.


Roles and Permissions

PS Hotel Booking provides a robust user role and permissions system, ensuring that hotel management can be efficiently distributed among staff while maintaining a secure environment.

 

Hotel Manager Role

The plugin introduces a custom user role called Hotel Manager, specifically designed for managing hotels, rooms, and bookings.

 

Assigning Hotel Managers
  • Navigate to the Users section in the WordPress admin dashboard.
  • Edit or create a new user and assign the role Hotel Manager.
  • In the user profile settings, you will find an additional option to assign the manager to specific hotels. If no hotel is assigned, the manager will have access to all hotels, rooms, and bookings within the system.

 

Permissions for Hotel Managers
  • Hotel-Specific Management:
    • When a manager is assigned to specific hotels, they will only be able to view and manage those hotels, their rooms, and associated bookings.
    • Managers will not have access to any hotels, rooms, or bookings outside their assigned scope.
  • Global Management:
    • If a manager is not assigned to any specific hotel, they will have full access to all hotels, rooms, and bookings across the system.

 

Capabilities of Hotel Managers

manager.png

Hotel Managers can perform the following actions:

  • Hotels:
    • View and edit hotel details.
  • Rooms:
    • Create, edit, and delete rooms.
    • Manage room settings, such as room types and room services.
  • Bookings:
    • View, confirm, or cancel bookings.

This role ensures that hotel operations can be delegated securely and efficiently, either by limiting access to specific hotels or providing full control over the entire system.


Working with the Plugin

Learn how to efficiently create and manage content, handle reservations, and ensure smooth operations for your hotel business.


Managing Hotels

How to Create and Manage Hotels

To manage hotels in the plugin, navigate to the Hotels section in the WordPress admin panel and click Add New Hotel. Fill out the following fields:

  • Title: Enter the name of the hotel.
  • Content: Provide a detailed description of the hotel.
  • Hotel Details: Fill in the custom fields such as:
    • Address: Specify the hotel's address.
    • Phone: Enter a contact phone number.
    • Email: Provide a contact email.
    • Rating (1-5): Assign a rating for the hotel.
    • Hotel Location: Use the Google Maps integration to pin the hotel's location.
  • Hotel Gallery: Upload multiple images showcasing the hotel.
  • Featured Image: Set a image for the hotel.

After entering all the details, click Publish to save the hotel.


Managing Rooms

How to Add and Manage Rooms

To manage rooms, navigate to the Rooms section in the WordPress admin panel and click Add New Room. Fill out the following fields:

  • Title: Enter the room's name (e.g., Presidential Suite).
  • Content: Provide a detailed description of the room.
  • Room Gallery: Upload images of the room to give potential guests a better idea of what it looks like.
  • Room Details: Specify room-specific information, including:
    • Price per Night: Enter the cost of the room per night.
    • Number of Rooms in the Suite: Specify how many rooms are included in this suite.
    • Adults: Maximum number of adults allowed.
    • Children: Maximum number of children allowed.
    • Single Beds: Number of single beds.
    • Double Beds: Number of double beds.
    • King Size Beds: Number of king-size beds.
  • Room Services: Select services available for this room (e.g., Air Conditioning, Coffee Maker, Daily Housekeeping). You can also add new services directly from this panel.
  • Room Types: Assign room types (e.g., Deluxe Room, Presidential Suite). You can add new types as needed.
  • Hotel: Assign the room to a specific hotel using the dropdown menu.
  • Featured Image: Set a image specific to the room.

Once all the details are entered, click Publish to save the room.


Managing Bookings

How to Adding and Managing Bookings

In the Bookings section, administrators and hotel managers can manage all existing bookings or add new ones.

  • Guest Name: The name of the guest for the booking.
  • Guest Email: The email address of the guest to receive notifications.
  • Guest Phone: The guest's contact phone number.
  • Check-in Date: The date when the guest will check in.
  • Check-out Date: The date when the guest will check out.
  • Adults: The number of adults included in the booking.
  • Children: The number of children included in the booking.
  • Notes: Additional notes or requests from the guest.
  • Room: The room associated with the booking.
  • Status: The current status of the booking (e.g., Confirmed, Pending, Cancelled).

Shortcodes and Widgets

Shortcodes

[ps_search_room_form]

This shortcode renders a room search and availability form. It accepts the following attributes:

  • hotel: (Optional) Restricts the search to a specific hotel by its ID.
  • show_adults: (Boolean) Whether to display the adults field in the search form. Default is false.
  • show_children: (Boolean) Whether to display the children field in the search form. Default is false.
  • columns: (Integer) Defines the number of columns for the layout of the form fields. Default is 1.

 

Examples
[ps_search_room_form  show_adults="1" show_children="1" columns="4"]

shortcode_1.png

 

[ps_search_room_form show_adults="1" show_children="0" columns=1]

shortcode_2.png

 

Widgets

The plugin provides the following widget-ready sidebars for enhanced customization:

  • Hotels Listing Sidebar: Appears on the page displaying the list of all hotels.
  • Single Hotel Sidebar: Appears on individual hotel pages.
  • Rooms Listing Sidebar: Appears on the page displaying the list of all rooms.
  • Single Room Sidebar: Appears on individual room pages.

Email Notifications

The PS Hotel Booking plugin includes the following types of email notifications to streamline communication with administrators, hotel managers, and guests:

Notification to Administrators
  • Purpose: Informs the website administrators about new bookings.
  • Recipients: Email addresses specified in the plugin settings (usually site administrators).
  • Trigger: Sent immediately after a new booking is created.

 

Notification to Hotel Managers
  • Purpose: Notifies the manager(s) of the hotel where the booking was made.
  • Recipients: Hotel managers assigned to the hotel in the plugin settings.
  • Trigger: Sent after a new booking is created only if the setting to notify hotel managers is enabled in the plugin settings.

 

Notification to Guests for Booking Confirmation
  • Purpose: Confirms the booking details for the guest when payment is not required or when payment is marked as "Cash"
  • Recipients: The guest who made the booking.
  • Trigger: Sent immediately after the booking is created if payment is not required or if "Cash on Delivery" was selected during the booking process.

Calendar Integration

The PS Hotel Booking plugin provides seamless calendar integration to help administrators, hotel managers, and guests manage bookings effectively. Below are the key features and functionalities of the calendar integration:

 

Bookings Calendar 

calendar_1.png

  • Purpose: Displays all bookings for a specific hotel or room in an intuitive calendar view.Access: Available in the admin panel under the Bookings section.
  • Features:
    •     Color-coded bookings: Easily distinguish booking statuses (e.g., Confirmed, Pending, Canceled).
    •     Interactive view: Hover over a booking to view details such as dates, hotel and room type.

 

Availability Calendar

calendar_2.png

  • Purpose: Displays room availability to help guests plan their bookings.
  • Placement: Can be displayed on the front-end using a shortcode or widget.
  • Features:
    •     Dynamic updates: Automatically reflects booking changes or cancellations.
    •     Date selection: Guests can select check-in and check-out dates based on availability.

Developer Guide

The PS Hotel Booking plugin includes several action hooks to allow developers to extend and customize its functionality. Below is a list of key hooks, their descriptions, and potential use cases.

1. ps_booking_created

  • Triggered: When a booking is created from the front-end by a guest.
  • Arguments:
    • $booking_id (int): The ID of the newly created booking.
  • Description: This hook is triggered immediately after a booking is successfully saved in the database.
  • Use Cases:
    • Send custom notifications to administrators or managers.
    • Integrate with third-party services (e.g., CRM systems).
    • Log booking creation events for analytics or debugging.

 

Example Usage
add_action( 'ps_booking_created', function( $booking_id ) {      $booking = get_post( $booking_id );      error_log( 'New booking created: ' . $booking->post_title );  } );

 

2. ps_booking_product_created

  • Triggered: When a hidden WooCommerce product is created for a booking (if payments are enabled).
  • Arguments:
    • $product_id (int): The ID of the created WooCommerce product.
    • $booking_id (int): The ID of the related booking.
  • Description: This hook is executed after the WooCommerce product linked to the booking is created.
  • Use Cases:
    • Modify product metadata (e.g., price, description).
    • Add additional actions related to the WooCommerce product (e.g., sync with an inventory system).
Example Usage
add_action( 'ps_booking_product_created', function( $product_id, $booking_id ) {      update_post_meta( $product_id, '_custom_field', 'value' );      error_log( 'Product for booking ' . $booking_id . ' created: Product ID ' . $product_id );  } );

 


Troubleshooting

This section helps you resolve common issues that may arise while using the PS Hotel Booking plugin.

 

 Issue: Cannot Update Hotel or Room
  • Symptom: An error message appears, stating, "You do not have permission to update this post."
  • Cause: Missing capabilities in user roles.
  • Solution:
    • Ensure that the user role (e.g., hotel manager) has the necessary capabilities, such as edit_ps_hotels, edit_ps_rooms, and edit_others_ps_rooms.
    • Verify that the capabilities parameter is correctly set in the custom post type registration.

 

Issue: Bookings Are Not Being Saved
  • Symptom: A new booking form submission does not appear in the admin panel.
  • Cause: Required fields might be missing or not validated correctly.
  • Solution:
    • Ensure all mandatory fields (e.g., Guest Name, Check-in Date) are filled.
    • Check if JavaScript or PHP validation errors are displayed in the browser console or server logs.

 

 Issue: Email Notifications Are Not Sent
  • Symptom: Admins or managers do not receive email notifications about new bookings.
  • Cause: Email server configuration issues or incorrect plugin settings.
  • Solution:
    • Verify email settings in your WordPress configuration (Settings > General).
    • Check the spam folder of the recipient email accounts.
    • Use an SMTP plugin to ensure reliable email delivery.

 

Issue: Shortcode [ps_search_room_form] Does Not Display
  • Symptom: The form does not appear when using the shortcode on a page.
  • Cause: Template rendering issues or incorrect shortcode attributes.
  • Solution:
    • Ensure the plugin is active and properly configured.
    • Check the attributes used in the shortcode for correctness.

 

 Issue: Calendar Does Not Load or Display Events
  • Symptom: The calendar remains empty or fails to load.
  • Cause: JavaScript errors or missing booking data.
  • Solution:
    • Check the browser console for JavaScript errors.
 
Issue: Payment Options Not Working
  • Symptom: Guests cannot complete payments or the payment gateway fails.
  • Cause: WooCommerce integration or configuration issue.
  • Solution:
    • Verify that WooCommerce is installed and activated.
    • Ensure the payment methods are configured in WooCommerce settings.
    • Check if the WooCommerce product is successfully created for the booking.

 

Issue: Plugin Conflicts
  • Symptom: Unexpected behavior occurs, such as broken layouts or functionality.
  • Cause: Conflict with another plugin or theme.
  • Solution:
    • Deactivate other plugins one by one to identify the conflict.
    • Switch to a default WordPress theme (e.g., Twenty Twenty-Three) and check if the issue persists.
    • Reach out to the plugin support team with details.

 

Issue: Google Maps Location Not Displaying
  • Symptom: The location map on the hotel page does not load.
  • Cause: Missing or invalid Google Maps API key.
  • Solution:
    • Obtain a valid API key from the Google Cloud Console.
    • Add the API key in the plugin settings or your WordPress theme.

 

If the issue persists after trying the solutions above, contact the plugin support team or consult the plugin documentation for further assistance.


FAQ

1. Can I use the plugin without WooCommerce?

Yes, the plugin can function without WooCommerce if payment functionality is not required. Guests can still make bookings, and you can manage them through the admin panel.

 

2. How do I assign a room to a specific hotel?

When creating or editing a room, use the Hotel Assignment dropdown in the room settings to select the desired hotel.

 

3. Why are email notifications not being sent?

Ensure that:

  • Email notifications are enabled in the plugin settings.
  • The recipient email address is correct.
  • Your server is configured to send emails. You can use an SMTP plugin for more reliable email delivery.

 

4. Can I customize the search form fields displayed by the shortcode?

Yes, the [ps_search_room_form] shortcode accepts attributes such as show_adults, show_children, and columns to customize the form. Refer to the documentation for details.

 

5. Can I add custom fields to the booking form?

Currently, the plugin does not support adding custom fields to the booking form through the admin panel. However, developers can use the ps_booking_created action to extend the functionality programmatically.

 

6. Is the plugin compatible with multilingual sites?

Yes, the plugin supports translation and can work with multilingual plugins like WPML or Polylang. Ensure that translations are added to the ps_hotel_booking text domain.

 

7. How do I handle refunds for canceled bookings?

If payments are handled via WooCommerce, refunds must be processed directly through the WooCommerce order management system.

 

8. Why are bookings not showing in the calendar?

Ensure the bookings have valid check-in and check-out dates. If the issue persists, check the plugin settings or your server logs for errors.

 
9. Can hotel managers only access their assigned hotels and rooms?

Yes, the plugin uses a custom role and capability system. Ensure that the hotel manager role is configured correctly to restrict access to assigned hotels and rooms.

 

 

If your question is not listed here, please refer to the documentation or contact the support team for further assistance.


License and Credits

Plugin License

This plugin is licensed under the Envato Regular/Extended License. Redistribution, modification, or unauthorized use without permission is strictly prohibited. For more details, please refer to the Envato licensing terms.

 

Third-Party Libraries and Resources

The following third-party libraries and resources are used in this plugin. Their respective licenses are included where applicable:

  • Google Maps API: Licensed under Google's Terms of Service. For more information, visit Google Maps API Terms.
  • Bootstrap 5: Licensed under the MIT License. For license details, visit Bootstrap License.
  • Line Awesome: Licensed under the MIT License. For license details, visit Line Awesome License.
  • Date Range Picker: Licensed under the MIT License. For license details, visit Date Range Picker License.
  • jQuery License: Licensed under the MIT License. For license details, visit jQuery License.
  • Moment.js: Licensed under the MIT License. For license details, visit Moment.js License.
  • FullCalendar: Licensed under the MIT License. For license details, visit FullCalendar License.
 
Special Thanks

We would like to express our gratitude to the open-source community and the authors of the resources mentioned above for their invaluable contributions.



Powered by PS SoftLab