( Latest versions: 2.7.3 Stable, compatible with Joomla 3.8.8+   &   0.9.3 Stable, compatible with WordPress 4+ )

Adult option backend not working with room type 3

More
2 months 2 weeks ago #12169 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; ?>

Please Log in or Create an account to join the conversation.

Moderators: solidres
Powered by Kunena Forum

All the things you need to make your work easier. Did you like Solidres?