Fixed: Children's age with Under 1 showing 0 in order detail page in back-office

This commit is contained in:
Sumit Panwar
2024-06-01 15:58:26 +05:30
parent 0dbd629048
commit 4740b83032
3 changed files with 22 additions and 10 deletions

View File

@@ -43,15 +43,19 @@
<td>
{if $order->with_occupancy && $data['children']}
<div class="dropdown booking_occupancy_show">
<button class="btn btn-default btn-left btn-block" data-toggle="dropdown" type="button">
<a data-toggle="dropdown">
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
</button>
</a>
<div class="dropdown-menu well well-sm">
<label>{l s='Children Ages'}</label>
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="">
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
{if $childAge == 0}
{l s='Child %s : Under 1' sprintf=[$childAge@iteration]}
{else}
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
{/if}
</p>
{/foreach}
{/if}

View File

@@ -70,7 +70,11 @@
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="">
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
{if $childAge == 0}
{l s='Child %s : Under 1' sprintf=[$childAge@iteration]}
{else}
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
{/if}
</p>
{/foreach}
{/if}

View File

@@ -3100,15 +3100,19 @@ class HotelBookingDetail extends ObjectModel
}
}
if ($bookedRoomInfoFlag && !$roomCount && $result) {
if (!$roomCount && $result) {
$link = new Link();
foreach ($result as $key => $bookingInfo) {
$result[$key]['booked_room_info'] = $this->chechRoomBooked($bookingInfo['id_room'], $bookingInfo['date_from'], $bookingInfo['date_to']);
$result[$key]['orders_filter_link'] = $link->getAdminLink('AdminOrders');
$result[$key]['child_ages'] = json_decode($bookingInfo['child_ages'], true);
// if need only rooms which are available to resolve overbooking the unset booked rooms
if ($bookedRoomInfoFlag == 2 && $result[$key]['booked_room_info']) {
unset($result[$key]);
if ($bookedRoomInfoFlag) {
$result[$key]['booked_room_info'] = $this->chechRoomBooked($bookingInfo['id_room'], $bookingInfo['date_from'], $bookingInfo['date_to']);
$result[$key]['orders_filter_link'] = $link->getAdminLink('AdminOrders');
// if need only rooms which are available to resolve overbooking the unset booked rooms
if ($bookedRoomInfoFlag == 2 && $result[$key]['booked_room_info']) {
unset($result[$key]);
}
}
}
}