Setting-up A Fully Automated Online Booking System With WooCommerce And WordPress

Woocommerce-online-bookings

Want to use WooCommerce to allow your customers to book services or rentals? Here’s how one can be implemented. The thing to keep in mind is that a comprehensive solution like this takes in-depth knowledge of the way WooCommerce works, the way these plugins integrate and function and putting it all together with custom code. You don’t want to risk business by hiring a newbie or going for a developer who quotes less. Chances are things will work at launch and then once they break there’s no end to the misery, the way poor code can make it unmanageable and it may just even need to be done from scratch.

In the long term, for business application you want to hire a seasoned pro who has implemented such solutions previously and has the foresight on how such a solution will work (and evolve / extend) with the growing business and business-requirements. With that said, here’s the latest work—the solution I implemented for a booking service.

A booking management system comprises of the following basic requirements to be ready for any real-world business usage; after all your business will be using this as a primary tool for offering bookings for services or rentals.

Requirements for the Automated Booking System

  • Configuration and setting up of intuitive booking management system using WooCommerce Bookings and Product add-on plugins.
  • Implementation and configuration of the following three packages. (Remember, packages will increase with time)
    • Package 1
    • Package 2
    • Package 3
  • Creation of required booking slots—the time when services / rentals are available and inventory management.
  • Setting up required rules for multi-person bookings (eg. in case of a service)
  • Support for bookings (and checkout) via front-end—of course!
  • Ability to create the bookings manually by staff members (via back-end). Comes in handy when someone wants to book over telephone.
  • Configuration and setting up of customer email notifications—so that customer can get notifications and status updates.
  • Custom-tailored booking costs to make provision for variable booking prices depending on the weekdays, weekends and number of persons—because sometimes it’s happy hours!
  • Google Calendar integration to sync the calendar bookings and appointments—personal preference. Google Calendar makes it easy to share a calendar with team-members who may not have access to the website backend. Of course Google Calendar comes with it’s own bells and whistles like automatic reminder etc.
  • Creation and integration of proposed product / service add-ons.
  • Integration with Paypal for processing the payment.

Plugins required for implementation of the booking solution in WooCommerce

Here’s how I made it sing. A robust and production ready system requires flawless integration and execution. I used the following plugins to achieve specific objectives to make life easier (for the client and for the customers)

  • Woocommerce bookings: — $249 Allows booking for a specific time-slot / fine-grained control over timings. Also used for Google Calendar integration.
  • Woocommerce accommodation bookings: — $0 Allows bookings spanning overnights.
  • Product Addons: — $45 Helps choose optional services / addons at the time of checkout.
  • Gift Cards: —$69 Allows users to create gift-cards on your site and gift them to family / friends.

Preparing for development of the WooCommerce Booking solution

Development has to be done on a development site that’s configured and matched exactly to the production site. This helps in eliminating any variables that may interfere during deployment to the production site and save us unhappy last-minute surprises or delays.

The entire production site was cloned and restored to a development server. Thus I was using the same theme, set of plugins and the environment that would be there on the production site.

Implementing customizations

Customizations must never be done to the plugin files lest they are gone after a plugin update. The right way to customize is via actions and filters in WordPress and WooCommerce. For this purpose you can start creating custom code using WP-Designer plugin. Once you have finalized the code and are through with the testing, right before deployment, you must move all the code to a must use plugin. Must use plugins can’t be disabled via WordPress back-end. They need to be disabled via direct access to files preferably via ftp or ssh.

The reason I used the WP-Designer plugin to implement code was because it allows you to keep all your custom code neatly organized into an external file that is untouchable by upgrades etc. As a bonus, you can use SCSS when styling. This helps you cut time and costs by styling smarter and faster.

I customized the email templates by hooking into WooCommerce filters woocommerce_email_subject_customer_completed_order etc.

Pricing breakdown at the backend was calculated as follows: Base-cost + Addon products + Taxes

A meta-box on the specific booking at the WordPress back-end can be implemented to show the pricing breakdown:

add_action( 'add_meta_boxes', 'mbh_add_lodging_soak_pricing_data_box', 11, 1 );

function mbh_add_lodging_soak_pricing_data_box() {
    add_meta_box( 'mbh-loding-soak-pricing-breakdown', __( 'Pricing Breakdown' ), 'mbh_display_order_data_in_admin', 'wc_booking', 'side', 'default' );
}

And in function mbh_display_order_data_in_admin you can use the $post variable to pull out the details

$total_base_cost = $base_cost = $taxes = $weekday_price = $weekend_price = $booking_duration = '';

Considerations: When a customer logs in to the site to checkout, it’s good to restrict the area and prevent prying eyes into the WordPress dashboard. Here’s the code for the same:

add_action( 'init', 'mbh_disable_user_admin_access' );

function mbh_disable_user_admin_access() {
    if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
        wp_redirect( get_site_url() );
        exit;
    }
}

Before deployment a complete backup of the site was taken and it’s integrity was verified. This makes double-sure that just in case luck does not favor you, things can be restored into perfect working order without a chance of breaking.

The project was completed with a comprehensive handover document to assist the client in managing the bookings in future.

Post deployment when the solution was churning in clients and making the bookings, here’s what the client mailed back:

You’ve done an amazing job. I don’t quite know how you manage but it’s rather remarkable!

When it’s amazing, it’s not only customer-satisfaction but also gives me great satisfaction and is a reiteration of the fact that I did something that backs-up claims of my ninja-skills and of the professionalism I bring to the table where serious business solutions are concerned.

Implementing this solution required about over a thousand lines of code. Implementation took about a month to go through testing and go-live. During this time as the client reviewed the work, I kept up with the project as the scope of work evolved. It’s only natural that every project evolves as time passes by. And the intention is not to limit yourself to the scope of work but to make sure that the work actually is a solution—something that solves a business problem, helps your business and gives you peace of mind.

If you are looking for a custom WooCommerce solution feel free to drop me a line and I’ll make sure everything is production perfect, up to your business objectives, is built for the long-term and is future proof. Thank you.

Screenshots:

Bookable Timings in the WooCommerce Bookings Solution
Bookable Timings in the WooCommerce Bookings Solution
Costs of the WooCommerce Booking Packages
Costs
Front-end of the WooCommerce Booking Solution
Front-end of the WooCommerce Booking Solution

Want to have your own booking solution implemented and start taking bookings / rental orders online? Please drop me a line and I’ll be happy to discuss and plan the implementation right from the start to the finish. Flawless execution to get you up and running. Thank you.

Divi WordPress Theme