- Posts: 3
- Home
- Forum
- Community Forum
- General discussions
- Media Manager
Adult option backend not working with room type 3
- Christoforos
- Topic Author
- Offline
Less
More
6 years 6 months ago #12169
by Christoforos
Adult option backend not working with room type 3 was created by Christoforos
When I select sytle3 on reservation then at the backend the form that load the room types always shows for selection the adult option. No mater if adult option or adult occupancy is set or not. by looking at the code it is missing the check for this attribute.
I corrected by entering the corresponding checks at the com_solidres/layouts/asset/rooms_style3.php
The correction I made are:
around 62 line:
if ( $roomType->params == 1 && $roomType->occupancy_adult > 0 ) :
$htmlAdultSelection = '';
$htmlAdultSelection .= '<option value="">' . JText::_( 'SR_ADULT' ) . '</option>';
for ( $j = 1; $j <= $roomType->occupancy_adult; $j ++ ) :
$selected = '';
if ( isset( $currentRoomIndex ) ) :
$selected = $currentRoomIndex == $j ? 'selected' : '';
else :
if ( $j == 1 ) :
$selected = 'selected';
endif;
endif;
$htmlAdultSelection .= '<option ' . $selected . ' value="' . $j . '">' . JText::plural( 'SR_SELECT_ADULT_QUANTITY', $j ) . '</option>';
endfor;
endif;
around 227:
<?php if ( $roomType->params == 1 && $roomType->occupancy_adult > 0 ) : ?>
<select
data-roomtypeid="<?php echo $roomType->id ?>"
data-tariffid="<?php echo isset($currentRoomIndex) ? $currentRoomIndex : ''?>"
data-adjoininglayer=""
data-roomid="<?php echo $room->id ?>"
data-max="<?php echo $roomType->occupancy_max ?>"
name="jform[room_types][<?php echo $roomType->id ?>][<?php echo $arrayHolder ?>][<?php echo $room->id ?>][adults_number]"
required
data-identity="<?php echo $identity ?>"
class="<?php echo SR_UI_GRID_COL_6 ?> adults_number occupancy_max_constraint occupancy_max_constraint_<?php echo $room->id ?>_<?php echo $arrayHolder ?>_<?php echo $roomType->id ?> occupancy_adult_<?php echo $roomType->id . '_' . $arrayHolder . '_' . $room->id ?> trigger_tariff_calculating"
<?php echo $room->isReservedForThisReservation ? '' : 'disabled' ?>
>
<?php echo $htmlAdultSelection ?>
</select>
<?php endif; ?>
I corrected by entering the corresponding checks at the com_solidres/layouts/asset/rooms_style3.php
The correction I made are:
around 62 line:
if ( $roomType->params == 1 && $roomType->occupancy_adult > 0 ) :
$htmlAdultSelection = '';
$htmlAdultSelection .= '<option value="">' . JText::_( 'SR_ADULT' ) . '</option>';
for ( $j = 1; $j <= $roomType->occupancy_adult; $j ++ ) :
$selected = '';
if ( isset( $currentRoomIndex ) ) :
$selected = $currentRoomIndex == $j ? 'selected' : '';
else :
if ( $j == 1 ) :
$selected = 'selected';
endif;
endif;
$htmlAdultSelection .= '<option ' . $selected . ' value="' . $j . '">' . JText::plural( 'SR_SELECT_ADULT_QUANTITY', $j ) . '</option>';
endfor;
endif;
around 227:
<?php if ( $roomType->params == 1 && $roomType->occupancy_adult > 0 ) : ?>
<select
data-roomtypeid="<?php echo $roomType->id ?>"
data-tariffid="<?php echo isset($currentRoomIndex) ? $currentRoomIndex : ''?>"
data-adjoininglayer=""
data-roomid="<?php echo $room->id ?>"
data-max="<?php echo $roomType->occupancy_max ?>"
name="jform[room_types][<?php echo $roomType->id ?>][<?php echo $arrayHolder ?>][<?php echo $room->id ?>][adults_number]"
required
data-identity="<?php echo $identity ?>"
class="<?php echo SR_UI_GRID_COL_6 ?> adults_number occupancy_max_constraint occupancy_max_constraint_<?php echo $room->id ?>_<?php echo $arrayHolder ?>_<?php echo $roomType->id ?> occupancy_adult_<?php echo $roomType->id . '_' . $arrayHolder . '_' . $room->id ?> trigger_tariff_calculating"
<?php echo $room->isReservedForThisReservation ? '' : 'disabled' ?>
>
<?php echo $htmlAdultSelection ?>
</select>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
Moderators: solidres