// load search rooms
$unit = $this->available_unit;
$search_rooms = $this->availability->results->search_rooms[$unit];
$party = $search_rooms->party;
// preapre rooms arrays
$first_unit = true;
$this->first_unit = true;
$this->first_rate = true;
$available_rooms = [];
$sold_out_rooms = [];
foreach ($this->availability->hotel->rooms as $room) {
    $this->room = $room;
    $this->available = CHLibData::getObjectFromList($search_rooms->available_rooms, $room->id, 'room_id');
    // the room will be displayed only if it's sold out, the room will be ignored for any other errors
    if (!$this->available) {
        $this->sold_out = CHClient::checkRoomSoldOut($unit, $room->id, $this->availability->errors);
        if (!$this->sold_out) {
            continue;
        }
        $this->first_unit = false;
        $sold_out_rooms[] = $this->loadTemplate('room');
    } else {
        $this->sold_out = false;
        $this->first_unit = $first_unit ? true : false;
        $available_rooms[] = $this->loadTemplate('room');
        $first_unit = false;
    }
}
?>

<!-- party -->