Thursday, 16 February 2012

Changing Joomla Rentalotplus component to take multiple bookings on each unit

Suitable for single user booking systems only

The aim here is to take have a unit/training centre where we can book multiple places ( number set in admin ) on various dates.

As rentalot is a booking system it's designed to book for groups and families, in my scenario users will only be booking for themselves and never for groups .

If your system is for booking groups then the following hack is of no use.

When installed and using the Daily view the process works like

> You see the calendar that shows you available dates

> on the next page you select the dates and click on the 'availability' check

> this then activates the check. it's this check that I've changed and therefor

allowing multiple bookings on the same unit on the same day.

Following the breadcrumbs back from the view I found where to enter the solution in

if you add the following function to this class


function maxPeople()
$unit_id = $this->_data->unit_id;

$sql="SELECT max_people FROM m37hf_rentalot_plus_units WHERE id='".$unit_id."' ";

$Result = $this->_db->loadObjectList();
//echo "$sql";
return $Result;



and then find 'function checkForBookingOverlaps'

UNDER $count = count($rows);



//find out how many spaces in the unit
$unitspaces = $this->maxPeople(); //DJ

then find the condition ($count != 0' )

and change this to

($count > $maxPeople)

No comments: