diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 95c1e7553..6600f921b 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -411,6 +411,14 @@ class ProductControllerCore extends FrontController $occupancy_value = array(); if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY) { $occupancy_value = 1; + } else { + $occupancy_value = array( + array( + 'adults' => $room_info_by_product_id['adults'], + 'children' => 0, + 'child_ages' => array(), + ), + ); } $this->assignBookingFormVars($this->product->id, $date_from, $date_to, $occupancy_value); $this->assignServiceProductVars(); @@ -728,7 +736,7 @@ class ProductControllerCore extends FrontController // calculate total price $totalPrice = $totalRoomPrice + $demandsPrice; // send occupancy information searched by the user - if ($this->ajax && $occupancy && is_array($occupancy)) { + if ($occupancy && is_array($occupancy)) { $smartyVars['occupancies'] = $occupancy; $smartyVars['occupancy_adults'] = array_sum(array_column($occupancy, 'adults')); $smartyVars['occupancy_children'] = array_sum(array_column($occupancy, 'children')); diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index 4adb17599..c97439103 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -63,8 +63,8 @@
- -
+ +
{$occupancy['children']|escape:'htmlall':'UTF-8'}