rEEservation

rEEservation is the add-on for ExpressionEngine 2.x that enables you to accept reservations/bookings on your website and handle them easily. In can be used to book hotel rooms, tickets for event etc.

Installation

Unzip the files into your /expressionengine/system/third_party directory. Then go to Add-ons/Modules section in your Control Panel and perform installation.

If you want to be able to send notification to customers when status of their booking changes, you should also enable the rEEservation extension.

If you want to enable your customer instant PayPal payment for the booking made, enable rEEservation PalPal extension and make sure Simple Commerce module is installed and all settings are correct. Fill in the settings for rEEservation PalPal extension as well. If you are using PayPal Sandbox, set var $debug = TRUE in both mod.simple_commerce.php and ext.reeservation_paypal.php

Add-on structure

The rEEservation add-on for ExpressionEngine consists of module and extension (and also optional extension to enable PayPal payments).

The module is responsible for creation of booking record, checking whether there are places available and displaying the booking details and for managing of reservations.

The extension is responsible for sending email notifications when status of the booking has been changed.

Please put attention that settings for rEEservation module, rEEservation extension and rEEservation PayPal extensions are edited separately.

To make use of module, you should create a channel in EE that will contain entries for objects that can be booked. Name it, for instance, 'Hotel'. Next, create entries in this channel that correspond to booking object. Name them, for instance, 'Room 1', 'Room 2', 'Room 3 Deluxe' etc. The entries can contain any data, you can use them to diplay information on your site's pages.

It is also possible to expand the add-on by creating your own extension. For example, you can integrate payment gateway. Or register member, if he's not registered yet. To do this, make use of following hooks:

Settings

On the settings page in the module's Control Panel you can set various settings. They include:

Statuses explained:

Email templates

The add-on is capable to send 4 types of notification: notification to user that his booking request has been received, notification to admin that there has been a new booking made, notification to object owner (entry author) that there has been a new booking made and (if the extension is installed) notification to user if the booking status has been changed.

All notifications are sent only if they are enabled in the settings. Owner notification is sent if the address is not listed as admin address.

Following variables are available in all templates:

Additionally, in admin notification template following variable is available:

In 'booking edited' template also available are:

Control Panel overview

In the module's Control Panel under 'Bookings' tab you can see the full list of booking requests posted.

You can narrow the results by performing a search. The reservations can be filtered by:

When you click the link on the object name, you are able to see booking details.

On that page you can change the booking status and also leave a comment.

If you have rEEservation extension installed, you can also choose to notify the user about the edit you made and optionally include the comment with the message.

Since version 2.4.2 you have the ability to create booking from Control Panel on behalf of your customers.

Usage

Available tags are:

exp:reeservation:form

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/themes/base/jquery-ui.css" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#date_from").datepicker({ dateFormat: "yy-mm-dd" });
$("#date_to").datepicker({ dateFormat: "yy-mm-dd" });
});
</script>
{exp:channel:entries}
<h3>{title}</h3>
{exp:reeservation:form entry_id="{entry_id}"}
{if logged_out}
<p>Name: <input type="text" name="name" /></p>
<p>Email: <input type="text" name="email" /></p>
{/if}
{if logged_in}
<p>Name: {logged_in_screen_name}</p>
<p>Email: {logged_in_email}</p>
{/if}
<p>Phone: <input type="text" name="phone" /></p>
<p>Other contact details: <textarea name="contact"></textarea></p>
<p>Booking dates:<br />
from <input type="text" name="date_from" id="date_from" value="{current_time format="%Y-%m-%d"}" /> to <input type="text" name="date_to" id="date_to" /></p>
<p>Leave a comment to your order: <textarea name="comment"></textarea></p>
{if captcha}
<p>CAPTCHA: <input type="text" name="captcha" /></p>
{captcha}
{/if}
<p><input type="submit" value="Proceed" /></p>
{/exp:reeservation:form}
{/exp:channel:entries}

Parameters:

Variables:

Conditional variables:

Form fields:

You can specify the dates in European or US format. 2011-12-31 and 12/31/11 are both valid. I recommend using jQuery datepicker calendar to set dates easily.

Alternative date fields.
Instead of letting user fill the date in required format, you can ask him to select year, month and day using dropdown selects.

So instead of date_from and date_to you can make use of following fields:

exp:reeservation:check

Use this tag to check object availability on a certain date.

{exp:reeservation:check entry_id="{segment_2}" day="{current_time format='%d'}" month="{current_time format='%m'}" year="{current_time format='%Y'}"}
{if no_results}
<a href="#booking_form">{day_number}</a>
{/if}
<div style="background: red"><a href="javascript:void(0)" title="{booking_details}Booked on {booking_date format="%Y-%m-%d"}{if booking_admin} by {name}{/if}{/booking_details}">{day_number}</a></div>
{/exp:reeservation:check}

Parameters:

You can, alternatively, perform check for a date range. If at least one date within the range is booked, the contents of tag pair is displayed. Otherwise, the contents of {if no_results} is displayed. To check for a date range, use parameters day_from, month_from, year_from, day_to, month_to, year_to instead of day, month and year.

Conditional variables:

Single variables outside {booking_details} tag pair:

You can display detailed booking info using booking_details tag pair.

Single variables inside {booking_details} tag pair:

exp:reeservation:check_multiple

Use this tag to check availability of several objects on a certain date.

{exp:reeservation:check_multiple entry_id="{segment_2}" day="{current_time format='%d'}" month="{current_time format='%m'}" year="{current_time format='%Y'}"}
{if no_results}
<a href="#booking_form">{day_number}</a>
{/if}
{entries}
<p>{title} has {bookings_count} places booked ({available} available)</p>
{/entries} {/exp:reeservation:check_multiple}

Parameters:

You can, alternatively, perform check for a date range. If at least one date within the range is booked, the contents of tag pair is displayed. Otherwise, the contents of {if no_results} is displayed. To check for a date range, use parameters day_from, month_from, year_from, day_to, month_to, year_to instead of day, month and year.

Conditional variables:

You can display availability info on each object using entries tag pair.

Single variables inside {entries} tag pair:

Outside of {entries} tag pair you have:

Simple calendar

Here's an example how to buld booking/availability using Simple Calendar plugin which is bundled with rEEservation.

{exp:simple_calendar entry_id="{segment_2}" start_day="sunday" month="{current_time format='%n'}" year="{current_time format='%Y'}"}
<h4>{current_time format="%F %Y"}</h4>
<table class="calendar" border="0" cellpadding="6" cellspacing="1" width="300px">
<tr>
{calendar_heading}
<th title="{lang:weekday_long}">{lang:weekday_abrev}</th>
{/calendar_heading}
</tr>
{calendar_rows}
{row_start}<tr>{/row_start}
<td{if today} class="today"{/if}>
{reeservation_check}
{if no_results}
{day_number}
{/if}
<a style="color: red" href="javascript:void(0)"
title="{booking_details}Booked on {booking_date format="%Y-%m-%d"}{if booking_admin} by {name}{/if}{/booking_details}">{day_number}</a>
{/reeservation_check}
</td>
{if empty}<td> </td>{/if}
{row_end}</tr>{/row_end}
{/calendar_rows}
</table>
{/exp:simple_calendar}

{reeservation_check} tag pair is basically calling exp:reeservation:check function, so all its variables and conditionals are available.

List and edit bookings

You can list all bookings that match certain parameter, such as entry author or customer using {exp:reeservation:listing} tag.

Accepted parameters are:

Ouput variables:

{exp:reeservation:listing owner_id="{segment_2}"}
<p><a href="{path=bookings/edit/{booking_id}}">{title}, booked from {date_from format="%Y-%m-%d"} to {date_to format="%Y-%m-%d"}</a></p>
{/exp:reeservation:listing}

To display booking edit form, place a call to exp:reeservation:listing with 2 parameters form="true" and booking_id.

The editing is available only for owner of booked object (and admins of course).

Following fields can be used in the form:

Parameters:

PayPal integration

Simple Commerce module is required for this feature to work, however nothing will be recorded in Simple Commerce module, so you don't need to define any items in there - just PayPal settings

You can enable your customers to pay for the bookings made instantly using PayPal. To do this, you'll need to have Simple Commerce module set up and rEEservation PayPal extension installed and set up.

Install the rEEservation PayPal extension, go to it's settings and make sure all fields are filled in. Price field should contain the cost of 1-day reservation. The total will be calculated based on the field value and number of days.

If you have several channels for booking, consider using Drifter extension for price field.

If you are using PayPal Sandbox, set var $debug = TRUE in both mod.simple_commerce.php and ext.reeservation_paypal.php

Make sure your default booking status is 'Pending'.

Now after the booking request has been received, the users will be instantly redirected to PayPal page. After they complete the payment, status of their order is set to Open/approved and notification email is sent. The user will be redirected to page you specify in extension settings or in 'return' parameter of booking form.

If you want to send notifications to customer/property owner/admin address, you should enable that in settings of 'rEEservation' extension.

Top of page