PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/helpers/conditionalrules/rooms.php +6 -3 1.6.8 → 1.8.16 View file →
@@ -188,8 +188,9 @@
188 188
189 189 // check sub-units
190 190 $use_sub_units = (int)$this->getParam('use_sub_units', 0);
191 191 if ($use_sub_units) {
192 + $sub_unit_matched = false;
192 193 // parse again the rooms booked
193 194 foreach ($rooms_booked as $rb) {
194 195 // grab the sub-unit index for this room id
195 196 $room_sub_unit_filt = (int)$this->getParam('sub_unit_' . $rb['idroom'], 0);
@@ -196,13 +197,15 @@
196 197 if (empty($room_sub_unit_filt)) {
197 198 // no sub-unit defined for this room ID
198 199 continue;
199 200 }
200 - if ($rb['roomindex'] != $room_sub_unit_filt) {
201 - // the index of the room booked is not the one in the params
202 - return false;
201 + if ($rb['roomindex'] == $room_sub_unit_filt) {
202 + // the index of the room booked matched the one in the params
203 + $sub_unit_matched = true;
203 204 }
204 205 }
206 +
207 + return $one_found && $sub_unit_matched;
205 208 }
206 209
207 210 // return true if at least one room booked is in the parameters
208 211 return $one_found;