diff --git a/js/admin/orders.js b/js/admin/orders.js
index 8a551b4fa..097961a27 100644
--- a/js/admin/orders.js
+++ b/js/admin/orders.js
@@ -2515,13 +2515,6 @@ const AddRoomBookingModal = {
$('#new_product .booking_guest_occupancy').removeClass('disabled');
setRoomTypeGuestOccupancy($('#new_product .booking_occupancy_wrapper'));
}
- if (data.room_type_info) {
- $('#new_product .max_adults').val(data.room_type_info.max_adults);
- $('#new_product .max_children').val(data.room_type_info.max_children);
- $('#new_product .max_guests').val(data.room_type_info.max_guests);
- $('#new_product .num_adults').attr('max', data.room_type_info.max_adults);
- $('#new_product .num_children').attr('max', data.room_type_info.max_children);
- }
// Keep product variable
current_product = data;
diff --git a/js/daterangepicker/qlodaterangepicker.js b/js/daterangepicker/qlodaterangepicker.js
index 369ea9325..401d2b6bc 100644
--- a/js/daterangepicker/qlodaterangepicker.js
+++ b/js/daterangepicker/qlodaterangepicker.js
@@ -22,6 +22,9 @@
var dateRangePickerOrg = $.fn.dateRangePicker;
$.fn.dateRangePicker = function(opt) {
if(typeof opt === "object") {
+ let container = $(this).parent();
+ container.css({ position: 'relative' });
+
const custom_opt = {
format: 'DD-MM-YYYY',
showTopbar: false,
@@ -31,14 +34,14 @@
minDays: 2,
startOfWeek: 'monday',
hoveringTooltip: false,
- container: '#page',
+ container: container,
+ inline: true,
customArrowPrevSymbol: '
',
customArrowNextSymbol: '
',
- getValue: function()
- {
+ getValue: function() {
return $(this).find('span').html();
},
- setValue: function(s, s1, s2) {
+ setValue: function(s) {
if (s) {
$(this).find('span').html(s.replace('to', '
'));
} else {
@@ -48,15 +51,56 @@
}
}
}
+
$.each(opt, function(index) {
delete custom_opt[index];
});
$.extend(true, opt, custom_opt);
-
}
var args = Array.prototype.slice.call(arguments,0);
- return dateRangePickerOrg.apply(this, args);
+
+ const dateRangePickerInput = dateRangePickerOrg.apply(this, args);
+ const calendarDom = $(dateRangePickerInput).data('dateRangePicker').getDatePicker();
+
+ dateRangePickerInput.on('datepicker-open', function() {
+ const positionClass = getPositionClass(dateRangePickerInput, calendarDom);
+ $(calendarDom).removeClass('top bottom').addClass(positionClass);
+ setPosition(dateRangePickerInput, calendarDom, positionClass)
+ });
+
+ return dateRangePickerInput;
+
+ // helper function definitions
+ function getPositionClass(dateRangePickerInput, calendarDom) {
+ const inputElementHeight = dateRangePickerInput.outerHeight();
+ const spaceTop = dateRangePickerInput.offset().top - $(window).scrollTop();
+ const spaceBottom = $(window).height() - inputElementHeight - spaceTop;
+ const maxHeightNeeded = $(calendarDom).get(0).scrollHeight;
+
+ let positionClass = 'bottom';
+ // determine position class
+ if (spaceBottom < maxHeightNeeded && spaceTop > spaceBottom) {
+ positionClass = 'top';
+ }
+
+ return positionClass;
+ }
+
+ function setPosition(dateRangePickerInput, calendarDom, positionClass) {
+ const inputElementHeight = dateRangePickerInput.outerHeight();
+
+ const css = {};
+ if (positionClass == 'top') {
+ css.top = 'unset';
+ css.bottom = inputElementHeight;
+ } else {
+ css.bottom = 'unset';
+ css.top = $(dateRangePickerInput).position().top + inputElementHeight;
+ }
+
+ $(calendarDom).css(css);
+ }
}
-})(jQuery);
\ No newline at end of file
+})(jQuery);
diff --git a/mails/en/partial_payment_accepted.html b/mails/en/partial_payment_accepted.html
new file mode 100644
index 000000000..45940907a
--- /dev/null
+++ b/mails/en/partial_payment_accepted.html
@@ -0,0 +1,138 @@
+
+
+
+
+
+
Message from {shop_name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Hi {firstname} {lastname},
+ Thank you for booking with {shop_name}!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Order {order_name} - Payment processed
+
+ Your payment for order with the reference {order_name} was successfully processed.
+
+ Total Booking Amount: {total_paid}
+ Partial Payment Amount: {advance_paid_amount}
+ Total Paid Amount: {total_paid_real}
+
+
+
+
+
+
+
+
+
+
+{extra_mail_content_html}
+
+
+
+
+ You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website.
+
+
+
+
+
+
+
+ If you have a guest account, you can follow your order via the "Guest Tracking" section on our website.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mails/en/partial_payment_accepted.txt b/mails/en/partial_payment_accepted.txt
new file mode 100644
index 000000000..799594197
--- /dev/null
+++ b/mails/en/partial_payment_accepted.txt
@@ -0,0 +1,26 @@
+
+[/{shop_url}]
+
+Hi {firstname} {lastname},
+
+Thank you for booking with {shop_name}!
+
+Order {order_name} - Payment processed
+
+Your payment for order with the reference {order_name} was successfully processed.
+
+Total Booking Amount: {total_paid}
+Partial Payment Amount: {advance_paid_amount}
+Total Paid Amount: {total_paid_real}
+
+You can review your order and download your invoice from the
+"Order history" [/{history_url}] section of your customer account by
+clicking "My account" [/{my_account_url}] on our website.
+
+If you have a guest account, you can follow your order via the
+"Guest Tracking" [/{guest_tracking_url}?id_order={order_name}] section
+on our website.
+
+{shop_name} [/{shop_url}] powered by Webkul(tm)
+[https://webkul.com]
+
diff --git a/modules/bankwire/bankwire.php b/modules/bankwire/bankwire.php
index a5add709a..442a6b97a 100644
--- a/modules/bankwire/bankwire.php
+++ b/modules/bankwire/bankwire.php
@@ -208,14 +208,16 @@ class Bankwire extends PaymentModule
}
$objOrder = $params['objOrder'];
- $orderState = $objOrder->getCurrentState();
+ $idOrderState = $objOrder->getCurrentState();
+ $objOrderState = new OrderState($idOrderState);
+ $history = $objOrder->getHistory($this->context->language->id);
+ $initialStatus = array_pop($history);
$smartyVars = array();
- if (in_array(
- $orderState,
- array(
- Configuration::get('PS_OS_AWAITING_PAYMENT'),
+ if ($idOrderState == Configuration::get('PS_OS_AWAITING_PAYMENT')
+ || ($objOrderState->logable
+ && $initialStatus['id_order_state'] == Configuration::get('PS_OS_AWAITING_PAYMENT')
)
- )) {
+ ) {
$objCart = new Cart($objOrder->id_cart);
if ($objCart->is_advance_payment) {
$cartTotal = $objOrder->getOrdersTotalPaid(1);
diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js
index c1cb4b1e7..9dfd93abd 100644
--- a/modules/blockcart/ajax-cart.js
+++ b/modules/blockcart/ajax-cart.js
@@ -478,6 +478,9 @@ var ajaxCart = {
else
$(callerElement).removeProp('disabled');
}
+ if (!addedFromProductPage) {
+ resetOccupancyField($(callerElement).closest('.booking_room_fields').find('.booking_occupancy_wrapper'));
+ }
emptyCustomizations();
},
diff --git a/modules/cheque/cheque.php b/modules/cheque/cheque.php
index 63bb05629..002f207e3 100644
--- a/modules/cheque/cheque.php
+++ b/modules/cheque/cheque.php
@@ -191,13 +191,15 @@ class Cheque extends PaymentModule
return;
}
$objOrder = $params['objOrder'];
- $orderState = $objOrder->getCurrentState();
- if (in_array(
- $orderState,
- array(
- Configuration::get('PS_OS_AWAITING_PAYMENT')
- )
- )) {
+ $idOrderState = $objOrder->getCurrentState();
+ $objOrderState = new OrderState($idOrderState);
+ $history = $objOrder->getHistory($this->context->language->id);
+ $initialStatus = array_pop($history);
+ if ($idOrderState == Configuration::get('PS_OS_AWAITING_PAYMENT')
+ || ($objOrderState->logable
+ && $initialStatus['id_order_state'] == Configuration::get('PS_OS_AWAITING_PAYMENT')
+ )
+ ) {
$objCart = new Cart($objOrder->id_cart);
if ($objCart->is_advance_payment) {
$cartTotal = $objOrder->getOrdersTotalPaid(1);
diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php
index dc32346d2..df5c6c616 100644
--- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php
+++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php
@@ -248,7 +248,7 @@ class HotelCartBookingData extends ObjectModel
*/
public function getCartCurrentDataByCartId($cart_id)
{
- $result = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'htl_cart_booking_data` WHERE `id_cart`='.$cart_id);
+ $result = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'htl_cart_booking_data` WHERE `id_cart`='.(int)$cart_id);
if ($result) {
return $result;
} else {
@@ -925,23 +925,34 @@ class HotelCartBookingData extends ObjectModel
return true;
}
+ // validate cart data if not available then remove from cart
public static function validateCartBookings()
{
$context = Context::getContext();
-
$errors = array();
+ $objModule = Module::getInstanceByName('hotelreservationsystem');
+
+ // For admin cart validations use this variable
+ $forAdminCart = 0;
+ if (isset($context->employee->id)) {
+ $forAdminCart = 1;
+ }
// validate room types if bookable from front office
if ($cartProducts = $context->cart->getProducts()) {
- $objHotelCartBookingData = new HotelCartBookingData();
- foreach ($cartProducts as $product) {
- if ($product['booking_product'] && !$product['show_at_front']) {
- $objHotelCartBookingData->deleteCartBookingData($context->cart->id, $product['id_product']);
+ if (!$forAdminCart) {
+ $objHotelCartBookingData = new HotelCartBookingData();
+ foreach ($cartProducts as $product) {
+ if ($product['booking_product'] && !$product['show_at_front']) {
+ $objHotelCartBookingData->deleteCartBookingData($context->cart->id, $product['id_product']);
+ }
}
}
+ } else {
+ $errors[] = $objModule->l('No booking found in the cart.', 'HotelOrderRestrictDate');
}
- // validate service products
+ // validate service products if not active not then remove from cart
if ($cartProducts = $context->cart->getProducts()) {
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
foreach ($cartProducts as $product) {
@@ -954,8 +965,20 @@ class HotelCartBookingData extends ObjectModel
}
}
+ // for admin/employee remove bookings of the back dates from cart if not allowed
+ if ($forAdminCart) {
+ if ($context->employee->isSuperAdmin()) {
+ $backOrderConfigKey = 'PS_BACKDATE_ORDER_SUPERADMIN';
+ } else {
+ $backOrderConfigKey = 'PS_BACKDATE_ORDER_EMPLOYEES';
+ }
+ if (!Configuration::get($backOrderConfigKey)) {
+ $objHotelCartBookingData = new HotelCartBookingData();
+ $objHotelCartBookingData->removeBackdateRoomsFromCart($context->cart->id);
+ }
+ }
+
// validate room types for restriction date
- $objModule = Module::getInstanceByName('hotelreservationsystem');
if ($cartProducts = $context->cart->getProducts()) {
$objHotelCartBookingData = new HotelCartBookingData();
$objHotelBookingDetail = new HotelBookingDetail();
@@ -977,43 +1000,43 @@ class HotelCartBookingData extends ObjectModel
}
foreach ($cartData as $roomData) {
- if ($maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($roomData['id_hotel'])) {
- if (strtotime('-1 day', strtotime($maxOrderDate)) < strtotime($roomData['date_from'])
- || strtotime($maxOrderDate) < strtotime($roomData['date_to'])
- ) {
- $objHotelBranchInformation = new HotelBranchInformation(
- $roomData['id_hotel'],
- $context->language->id
- );
- $errors[] = sprintf(
- 'You can not book rooms for hotel \'%s\' after date %s. Please remove rooms from %s - %s to proceed.',
- $objHotelBranchInformation->hotel_name,
- Tools::displayDate($maxOrderDate),
- Tools::displayDate($roomData['date_from']),
- Tools::displayDate($roomData['date_to'])
- );
- $error = true;
+ if (!$forAdminCart) {
+ if ($maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($roomData['id_hotel'])) {
+ if (strtotime('-1 day', strtotime($maxOrderDate)) < strtotime($roomData['date_from'])
+ || strtotime($maxOrderDate) < strtotime($roomData['date_to'])
+ ) {
+ $objHotelBranchInformation = new HotelBranchInformation(
+ $roomData['id_hotel'],
+ $context->language->id
+ );
+ $errors[] = sprintf(
+ 'You can not book rooms for hotel \'%s\' after date %s. Please remove rooms from %s - %s to proceed.',
+ $objHotelBranchInformation->hotel_name,
+ Tools::displayDate($maxOrderDate),
+ Tools::displayDate($roomData['date_from']),
+ Tools::displayDate($roomData['date_to'])
+ );
+ }
}
- }
- $preparationTime = HotelOrderRestrictDate::getPreparationTime($roomData['id_hotel']);
- if ($preparationTime !== false) {
- $minOrderDate = date('Y-m-d', strtotime('+'. ($preparationTime) .' days'));
- if (strtotime($minOrderDate) > strtotime($roomData['date_from'])
- || strtotime($minOrderDate . ' +1 day')> strtotime($roomData['date_to'])
- ) {
- $objHotelBranchInformation = new HotelBranchInformation(
- $roomData['id_hotel'],
- $context->language->id
- );
- $errors[] = sprintf(
- 'You can not book rooms for hotel \'%s\' before date %s. Please remove rooms from %s - %s to proceed.',
- $objHotelBranchInformation->hotel_name,
- Tools::displayDate($minOrderDate),
- Tools::displayDate($roomData['date_from']),
- Tools::displayDate($roomData['date_to'])
- );
- $error = true;
+ $preparationTime = HotelOrderRestrictDate::getPreparationTime($roomData['id_hotel']);
+ if ($preparationTime !== false) {
+ $minOrderDate = date('Y-m-d', strtotime('+'. ($preparationTime) .' days'));
+ if (strtotime($minOrderDate) > strtotime($roomData['date_from'])
+ || strtotime($minOrderDate . ' +1 day')> strtotime($roomData['date_to'])
+ ) {
+ $objHotelBranchInformation = new HotelBranchInformation(
+ $roomData['id_hotel'],
+ $context->language->id
+ );
+ $errors[] = sprintf(
+ 'You can not book rooms for hotel \'%s\' before date %s. Please remove rooms from %s - %s to proceed.',
+ $objHotelBranchInformation->hotel_name,
+ Tools::displayDate($minOrderDate),
+ Tools::displayDate($roomData['date_from']),
+ Tools::displayDate($roomData['date_to'])
+ );
+ }
}
}
@@ -1025,32 +1048,27 @@ class HotelCartBookingData extends ObjectModel
'only_search_data' => 1,
);
$bookingSearchData = $objHotelBookingDetail->dataForFrontSearch($bookingParams);
- $isRmBooked = 0;
+ $isRoomBooked = 0;
if (count($bookingSearchData['rm_data'][$product['id_product']]['data']['available']) < count($roomData['id_rms'])) {
foreach ($roomData['id_rms'] as $searchRoomData) {
- if($isRmBooked = $objHotelBookingDetail->chechRoomBooked($searchRoomData, $roomData['date_from'], $roomData['date_to'])){
+ if($isRoomBooked = $objHotelBookingDetail->chechRoomBooked($searchRoomData, $roomData['date_from'], $roomData['date_to'])){
break;
}
}
- if ($isRmBooked) {
+ if ($isRoomBooked) {
$errors[] = sprintf($objModule->l('The Room \'%s\' has been booked by another customer from \'%s\' to \'%s\' Please remove rooms from cart to proceed', 'HotelOrderRestrictDate'), $product['name'], date('d-m-Y', strtotime($roomData['date_from'])), date('d-m-Y', strtotime($roomData['date_to'])));
- $error = true;
} else {
$errors[] = sprintf($objModule->l('The Room \'%s\' is no longer avalable from \'%s\' to \'%s\' Please remove rooms from cart to proceed', 'HotelOrderRestrictDate'), $product['name'], date('d-m-Y', strtotime($roomData['date_from'])), date('d-m-Y', strtotime($roomData['date_to'])));
- $error = true;
}
}
}
}
} else {
- $error = true;
$errors[] = $objModule->l('You can not book rooms from "', 'HotelOrderRestrictDate'). $product['name'] .$objModule->l('". Please remove rooms from "', 'HotelOrderRestrictDate'). $product['name'] . $objModule->l('" from cart to proceed.', 'HotelOrderRestrictDate');
}
}
}
- $context->controller->errors = array_merge($context->controller->errors, $errors);
-
return $errors;
}
diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php
index 8aee39b6f..0b615f59a 100644
--- a/modules/hotelreservationsystem/classes/HotelHelper.php
+++ b/modules/hotelreservationsystem/classes/HotelHelper.php
@@ -199,6 +199,8 @@ class HotelHelper
Configuration::updateValue('WK_HOTEL_LOCATION_ENABLE', 1);
Configuration::updateValue('WK_HOTEL_NAME_ENABLE', 1);
+ Configuration::updateValue('WK_HOTEL_NAME_SEARCH_THRESHOLD', 5);
+ Configuration::updateValue('WK_SEARCH_AUTO_FOCUS_NEXT_FIELD', 1);
Configuration::updateValue('WK_ROOM_LEFT_WARNING_NUMBER', 10);
Configuration::updateValue('WK_HTL_ESTABLISHMENT_YEAR', 2010);
diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php
index 5fad5a10b..e40082572 100644
--- a/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php
+++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php
@@ -94,7 +94,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
)) {
$updateQty = $product['quantity'];
if (Product::getProductPriceCalculation($product['id_product']) == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
- $objHotelCartBookingData = new HotelCartBookingData($idHtlCartData);
+ $objHotelCartBookingData = new HotelCartBookingData($htlCartBookingId);
$numdays = HotelHelper::getNumberOfDays($objHotelCartBookingData->date_from, $objHotelCartBookingData->date_to);
$updateQty *= $numdays;
}
diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php
index bfbf62f2b..7300566ee 100644
--- a/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php
+++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php
@@ -72,8 +72,10 @@ class RoomTypeServiceProductPrice extends ObjectModel
if ($result = Db::getInstance()->getRow('
SELECT spp.`price`, spp.`id_tax_rules_group`, p.`auto_add_to_cart`, p.`price_addition_type`
FROM `'._DB_PREFIX_.'product` p
- LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` sp ON (sp.`id_product` = p.`id_product`)
- LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_price` spp ON (spp.`id_product` = p.`id_product`)
+ LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` sp
+ ON (sp.`id_product` = p.`id_product`)
+ LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_price` spp
+ ON (spp.`id_product` = sp.`id_product` AND spp.`id_element` = sp.`id_element` AND spp.`element_type` = sp.`element_type`)
WHERE p.`id_product`='.(int)$idProduct.
' AND sp.`id_element`='.(int)$idElement.
' AND sp.`element_type`='.(int)$elementType)
diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php
index 30b34ea38..2d8d7ff6d 100644
--- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php
+++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php
@@ -81,6 +81,32 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
'hint' => $this->l('This option can be disabled if only one active hotel in the website.
In case of more than one active hotel, Hotel Name will always be shown in the search panel.'),
),
+ 'WK_SEARCH_AUTO_FOCUS_NEXT_FIELD' => array(
+ 'title' => $this->l('Focus next field automatically'),
+ 'cast' => 'intval',
+ 'type' => 'bool',
+ 'default' => '0',
+ 'values' => array(
+ array(
+ 'id' => 'active_on',
+ 'value' => 1,
+ ),
+ array(
+ 'id' => 'active_off',
+ 'value' => 0,
+ ),
+ ),
+ 'hint' => $this->l('Enable if you want the next booking search field to be focused automatically after setting value for a field.'),
+ ),
+ 'WK_HOTEL_NAME_SEARCH_THRESHOLD' => array(
+ 'title' => $this->l('Hotel name search threshold'),
+ 'type' => 'text',
+ 'required' => true,
+ 'validation' => 'isUnsignedInt',
+ 'hint' => $this->l('Enter the number of hotels after which user can search hotel by name.'),
+ 'desc' => $this->l('Set to 0 to always show the search box.'),
+ 'class' => 'fixed-width-xxl',
+ ),
),
'submit' => array(
'title' => $this->l('Save'),
@@ -312,6 +338,8 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
public function postProcess()
{
if (Tools::isSubmit('submitOptions'.$this->table)) {
+ $hotelNameSearchThreshold = Tools::getValue('WK_HOTEL_NAME_SEARCH_THRESHOLD');
+
// check if field is atleast in default language. Not available in default prestashop
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
@@ -324,6 +352,12 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
// End occupancy fields validation
+ if (!$hotelNameSearchThreshold && $hotelNameSearchThreshold !== '0') {
+ $this->errors[] = $this->l('Hotel name search threshold field is required.');
+ } elseif (!Validate::isUnsignedInt($hotelNameSearchThreshold)) {
+ $this->errors[] = $this->l('Hotel name search threshold field is invalid.');
+ }
+
if (!trim(Tools::getValue('WK_HTL_CHAIN_NAME_'.$defaultLangId))) {
$this->errors[] = $this->l('Hotel chain name is required at least in ').$objDefaultLanguage['name'];
} else {
diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php
index 0edf2d641..04b02fe59 100644
--- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php
+++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php
@@ -42,6 +42,9 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$objCart = new Cart($this->context->cookie->id_cart);
if (Validate::isLoadedObject($objCart) && !$objCart->orderExists()) {
$this->context->cart = $objCart;
+
+ // validate cart for removing invalid data from cart
+ HotelCartBookingData::validateCartBookings();
} else {
$this->context->cookie->id_cart = 0; // remove invalid id_cart
$this->context->cart = new Cart();
@@ -63,15 +66,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$objCustomer->id_guest = (int) $this->context->cookie->id_guest;
$this->context->customer = $objCustomer;
- if ($this->context->employee->isSuperAdmin()) {
- $backOrderConfigKey = 'PS_BACKDATE_ORDER_SUPERADMIN';
- } else {
- $backOrderConfigKey = 'PS_BACKDATE_ORDER_EMPLOYEES';
- }
- if (!Configuration::get($backOrderConfigKey)) {
- $htlCart = new HotelCartBookingData();
- $htlCart->removeBackdateRoomsFromCart($this->context->cart->id);
- }
}
protected function createNewCart()
@@ -819,19 +813,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$objHotelRoomType = new HotelRoomType();
foreach ($booking_data['rm_data'] as $key_bk_data => $value_bk_data) {
$booking_data['rm_data'][$key_bk_data]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value_bk_data['id_product']);
-
- // set default occupancies in required format
- $occupancy = array(
- array(
- 'adults' => $value_bk_data['adults'],
- 'children' => 0,
- 'child_ages' => array(),
- ),
- );
-
- $booking_data['rm_data'][$key_bk_data]['occupancies'] = $occupancy;
- $booking_data['rm_data'][$key_bk_data]['occupancy_adults'] = $booking_data['rm_data'][$key_bk_data]['adults']; // only one room by default
-
if (isset($value_bk_data['data']['booked']) && $value_bk_data['data']['booked']) {
foreach ($value_bk_data['data']['booked'] as $booked_k1 => $booked_v1) {
if (isset($booked_v1['detail']) && $booked_v1['detail']) {
diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php
index bf6473245..76a6c3bae 100644
--- a/modules/hotelreservationsystem/hotelreservationsystem.php
+++ b/modules/hotelreservationsystem/hotelreservationsystem.php
@@ -509,6 +509,7 @@ class HotelReservationSystem extends Module
'htl_room_type_global_demand',
'htl_room_type_global_demand_advance_option',
'htl_order_refund_rules',
+ 'htl_settings_link',
);
//If Admin update new language when we do entry in module all lang tables.
HotelHelper::updateLangTables($newIdLang, $langTables);
diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl
index 20013d8d0..70bcd1cd3 100644
--- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl
+++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl
@@ -56,79 +56,40 @@
-
- {if isset($book_v['occupancies']) && $book_v['occupancies']}
- {if (isset($book_v['occupancy_adults']) && $book_v['occupancy_adults'])}{$book_v['occupancy_adults']} {if $book_v['occupancy_adults'] > 1}{l s='Adults' mod='hotelreservationsystem'}{else}{l s='Adult' mod='hotelreservationsystem'}{/if}, {if isset($book_v['occupancy_children']) && $book_v['occupancy_children']}{$book_v['occupancy_children']} {if $book_v['occupancy_children'] > 1} {l s='Children' mod='hotelreservationsystem'}{else}{l s='Child' mod='hotelreservationsystem'}{/if}, {/if}{$book_v['occupancies']|count} {if $book_v['occupancies']|count > 1}{l s='Rooms' mod='hotelreservationsystem'}{else}{l s='Room' mod='hotelreservationsystem'}{/if}{else}{l s='1 Adult, 1 Room' mod='hotelreservationsystem'}{/if}
- {else}
- {l s='Select occupancy' mod='hotelreservationsystem'}
- {/if}
-
+ {l s='Select occupancy' mod='hotelreservationsystem'}