added minor occupancy changes
This commit is contained in:
@@ -93,9 +93,12 @@
|
||||
</button>
|
||||
<input type="hidden" class="max_avail_type_qty" value="">
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
|
||||
<div class="booking_occupancy_inner row">
|
||||
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1'}</label></div>
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="">
|
||||
<input type="hidden" class="max_children" value="">
|
||||
<input type="hidden" class="max_guests" value="">
|
||||
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1'}</label></div>
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
|
||||
@@ -358,11 +358,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$order->is_occupnacy_provided = 0;
|
||||
} else {
|
||||
if (defined('_PS_ADMIN_DIR_')) {
|
||||
if (Configuration::get('PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$order->is_occupnacy_provided = 1;
|
||||
}
|
||||
} else {
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$order->is_occupnacy_provided = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,6 +439,11 @@ class FrontControllerCore extends Controller
|
||||
if (Configuration::get('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
|
||||
$occupancyWiseSearch = true;
|
||||
}
|
||||
|
||||
$bookingTypeOccupancy = false;
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$bookingTypeOccupancy = true;
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
// Useful for layout.tpl
|
||||
'mobile_device' => $this->context->getMobileDevice(),
|
||||
@@ -487,7 +492,7 @@ class FrontControllerCore extends Controller
|
||||
'currencyFormat' => $currency->format, // backward compat
|
||||
'currencyBlank' => $currency->blank, // backward compat
|
||||
'occupancy_wise_search' => $occupancyWiseSearch,
|
||||
'occupancy_required_for_booking' => Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING'),
|
||||
'occupancy_required_for_booking' => $bookingTypeOccupancy,
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
));
|
||||
|
||||
@@ -246,6 +246,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$payment_modules[] = Module::getInstanceById((int)$p_module['id_module']);
|
||||
}
|
||||
|
||||
$bookingTypeOccupancy = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$bookingTypeOccupancy = true;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'recyclable_pack' => (int)Configuration::get('PS_RECYCLABLE_PACK'),
|
||||
'gift_wrapping' => (int)Configuration::get('PS_GIFT_WRAPPING'),
|
||||
@@ -262,7 +267,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'title' => array($this->l('Orders'), $this->l('Create order')),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'occupancy_required_for_booking' => Configuration::get('PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING'),
|
||||
'occupancy_required_for_booking' => $bookingTypeOccupancy,
|
||||
));
|
||||
$this->content .= $this->createTemplate('form.tpl')->fetch();
|
||||
}
|
||||
@@ -2508,7 +2513,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Invalid quantity.'),
|
||||
)));
|
||||
} elseif (!Validate::isUnsignedInt($adults)) {
|
||||
} elseif (!isset($adults) || !$adults || !Validate::isUnsignedInt($adults)) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Invalid number of adults.'),
|
||||
|
||||
@@ -129,7 +129,7 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
'desc' => $this->l('Choose "Occupancy wise search" or "Search without occupancy". Occupancy search restriction will depend on this option selection at front end.'),
|
||||
),
|
||||
'PS_FRONT_OWS_SEARCH_ALGO_TYPE' => array(
|
||||
'title' => $this->l('Front end occupancy wise search algorithm '),
|
||||
'title' => $this->l('Front end occupancy wise search algorithm'),
|
||||
'hint' => $this->l('In occupancy wise search at front end, you want to display only room types which are fully satisfying searched occupancy or you want to display all the available room types for the dates searched'),
|
||||
'cast' => 'intval',
|
||||
'type' => 'select',
|
||||
@@ -137,13 +137,19 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
array('id' => HotelBookingDetail::SEARCH_EXACT_ROOM_TYPE_ALGO, 'name' => $this->l('Show room types satisfying required occupancy')),
|
||||
array('id' => HotelBookingDetail::SEARCH_ALL_ROOM_TYPE_ALGO, 'name' => $this->l('Show all available room types'))
|
||||
),
|
||||
'identifier' => 'id'
|
||||
'identifier' => 'id',
|
||||
'desc' => $this->l('This option is only for fully available rooms. For partially available rooms, always all possible rooms will be displayed.'),
|
||||
),
|
||||
'PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING' => array(
|
||||
'title' => $this->l('Front end occupancy required for booking'),
|
||||
'hint' => $this->l('Select occupancy is required for booking a room for frontend. When enabled occupancy field will be shown in the booking form.'),
|
||||
'PS_FRONT_ROOM_BOOKING_TYPE' => array(
|
||||
'title' => $this->l('In front-end, add rooms to cart with'),
|
||||
'hint' => $this->l('In Room occupancy, while adding rooms in cart customer has to select per room occupancy and in room quantity customer only has to select number of rooms.'),
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool',
|
||||
'type' => 'select',
|
||||
'list' => array(
|
||||
array('id' => HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE, 'name' => $this->l('Room Occupancy')),
|
||||
array('id' => HotelBookingDetail::ROOM_BOOKING_QUANTITY_WISE, 'name' => $this->l('Rooms Quantity (No. of rooms)'))
|
||||
),
|
||||
'identifier' => 'id',
|
||||
),
|
||||
'PS_BACKOFFICE_SEARCH_TYPE' => array(
|
||||
'title' => $this->l('Back-office search type'),
|
||||
@@ -169,11 +175,16 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
'identifier' => 'id',
|
||||
'desc' => $this->l('This option is only for fully available rooms. For partially available rooms, always all possible rooms will be displayed.'),
|
||||
),
|
||||
'PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING' => array(
|
||||
'title' => $this->l('Back-office occupancy required for booking'),
|
||||
'hint' => $this->l('Select occupancy is required for booking a room for frontend. When enabled occupancy field will be shown in the booking form.'),
|
||||
'PS_BACKOFFICE_ROOM_BOOKING_TYPE' => array(
|
||||
'title' => $this->l('In back-office, add rooms to cart with'),
|
||||
'hint' => $this->l('In Room occupancy, while adding rooms in cart customer has to select per room occupancy and in room quantity customer only has to select number of rooms.'),
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool',
|
||||
'type' => 'select',
|
||||
'list' => array(
|
||||
array('id' => HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE, 'name' => $this->l('Room Occupancy')),
|
||||
array('id' => HotelBookingDetail::ROOM_BOOKING_QUANTITY_WISE, 'name' => $this->l('Rooms Quantity (No. of rooms)'))
|
||||
),
|
||||
'identifier' => 'id',
|
||||
),
|
||||
'PS_LOS_RESTRICTION_BO' => array(
|
||||
'title' => $this->l('Apply Min and Max lenght of stay restrictions for back-office search'),
|
||||
@@ -398,9 +409,28 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
if (Tools::getValue('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
|
||||
$_POST['PS_FRONT_ROOM_BOOKING_TYPE'] = HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE;
|
||||
}
|
||||
|
||||
if (Tools::getValue('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
|
||||
$_POST['PS_BACKOFFICE_ROOM_BOOKING_TYPE'] = HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE;
|
||||
}
|
||||
|
||||
if (Tools::getIsset('PS_CATALOG_MODE')) {
|
||||
Tools::clearSmartyCache();
|
||||
Media::clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
|
||||
Media::addJsDef(array(
|
||||
'SEARCH_TYPE_OWS' => HotelBookingDetail::SEARCH_TYPE_OWS
|
||||
));
|
||||
|
||||
$this->addJS(_PS_JS_DIR_.'admin/ppreferences.js');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3482,6 +3482,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('Invalid maximum number of guests');
|
||||
} elseif ($maxGuests < ($baseAdults + $baseChildren)) {
|
||||
$this->errors[] = Tools::displayError('Maximum number of guests cannot be less than base occupancy of adults and children');
|
||||
} elseif ($maxGuests > ($maxChildren + $maxAdults)) {
|
||||
$this->errors[] = Tools::displayError('Maximum number of guests cannot be more than max occupancy of adults and children');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
|
||||
@@ -268,15 +268,22 @@ class CartControllerCore extends FrontController
|
||||
$date_to = Tools::getValue('dateTo');
|
||||
$date_from = date("Y-m-d", strtotime($date_from));
|
||||
$date_to = date("Y-m-d", strtotime($date_to));
|
||||
$operator = Tools::getValue('op', 'up');
|
||||
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
$bookingTypeOccupancy = false;
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$bookingTypeOccupancy = true;
|
||||
}
|
||||
|
||||
if ($bookingTypeOccupancy) {
|
||||
if ($occupancy = json_decode(Tools::getValue('occupancy'), true)) {
|
||||
$this->qty = count($occupancy);
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Invalid occupnacy.');
|
||||
}
|
||||
} else {
|
||||
$this->qty = Tools::getValue('occupancy');
|
||||
$occupancy = Tools::getValue('qty');
|
||||
$this->qty = $occupancy;
|
||||
}
|
||||
|
||||
$id_cart = $this->context->cart->id;
|
||||
@@ -295,23 +302,25 @@ class CartControllerCore extends FrontController
|
||||
}
|
||||
|
||||
// valdiate occupancy if providede
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
foreach($occupancy as $key => $roomOccupancy) {
|
||||
if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1));
|
||||
}
|
||||
if (isset($roomOccupancy['children'])) {
|
||||
if (!Validate::isUnsignedInt($roomOccupancy['children'])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1));
|
||||
if ($operator == 'up') {
|
||||
if ($bookingTypeOccupancy) {
|
||||
foreach($occupancy as $key => $roomOccupancy) {
|
||||
if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1));
|
||||
}
|
||||
if ($roomOccupancy['children'] > 0) {
|
||||
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1));
|
||||
} else {
|
||||
if (is_array($roomOccupancy['child_ages'])) {
|
||||
foreach($roomOccupancy['child_ages'] as $childAge) {
|
||||
if (!Validate::isUnsignedInt($childAge)) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1));
|
||||
if (isset($roomOccupancy['children'])) {
|
||||
if (!Validate::isUnsignedInt($roomOccupancy['children'])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1));
|
||||
}
|
||||
if ($roomOccupancy['children'] > 0) {
|
||||
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1));
|
||||
} else {
|
||||
if (is_array($roomOccupancy['child_ages'])) {
|
||||
foreach($roomOccupancy['child_ages'] as $childAge) {
|
||||
if (!Validate::isUnsignedInt($childAge)) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,7 +348,7 @@ class CartControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('You can\'t book room after date '.$maxOrdDate);
|
||||
}
|
||||
}
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if ($bookingTypeOccupancy) {
|
||||
foreach($occupancy as $key => $roomOccupancy) {
|
||||
if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']);
|
||||
@@ -458,7 +467,6 @@ class CartControllerCore extends FrontController
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$roomDemand = json_decode(Tools::getValue('roomDemands'), true);
|
||||
$roomDemand = json_encode($roomDemand);
|
||||
$operator = Tools::getValue('op', 'up');
|
||||
$this->availQty = $total_available_rooms;
|
||||
$update_quantity = $objHotelCartBookingData->updateRoomCartBookingData(
|
||||
$this->id_product,
|
||||
|
||||
@@ -509,7 +509,7 @@ class ProductControllerCore extends FrontController
|
||||
'id_cart' => $idCart,
|
||||
'id_guest' => $idGuest,
|
||||
);
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$bookingParams['occupancy'] = $occupancy;
|
||||
$quantity = count($occupancy);
|
||||
} else {
|
||||
|
||||
@@ -385,6 +385,9 @@ function init()
|
||||
$('tr#new_product input, tr#new_product select, tr#new_product button').removeAttr('disabled');
|
||||
$('tr#new_product .booking_guest_occupancy').removeClass('disabled');
|
||||
if (data.room_type_info) {
|
||||
$('tr#new_product .max_adults').val(data.room_type_info.max_adults);
|
||||
$('tr#new_product .max_children').val(data.room_type_info.max_children);
|
||||
$('tr#new_product .max_guests').val(data.room_type_info.max_guests);
|
||||
$('tr#new_product .num_adults').attr('max', data.room_type_info.max_adults);
|
||||
$('tr#new_product .num_children').attr('max', data.room_type_info.max_children);
|
||||
}
|
||||
@@ -524,12 +527,21 @@ function init()
|
||||
if ($(this).val() > $(this).attr('max')) {
|
||||
$(this).val($(this).attr('max'));
|
||||
}
|
||||
if ($(this).val() < $(this).attr('min')) {
|
||||
$(this).val($(this).attr('min'));
|
||||
}
|
||||
if ($(this).val() > max_allowed_for_current) {
|
||||
$(this).val(max_allowed_for_current);
|
||||
}
|
||||
if ($(this).hasClass('num_children')) {
|
||||
var totalChilds = $(this).closest('.occupancy_info_block').find('.guest_child_age').length;
|
||||
if (totalChilds < $(this).val()) {
|
||||
let max_child_in_room;
|
||||
if ($(this).closest(".booking_occupancy_wrapper").find('.max_children').val()) {
|
||||
max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val();
|
||||
} else {
|
||||
max_child_in_room = window.max_child_in_room;
|
||||
}
|
||||
if (totalChilds < max_child_in_room) {
|
||||
$(this).closest('.occupancy_info_block').find('.children_age_info_block').show();
|
||||
while ($(this).closest('.occupancy_info_block').find('.guest_child_age').length < $(this).val()) {
|
||||
@@ -613,11 +625,7 @@ function init()
|
||||
}
|
||||
if (hasErrors == 0) {
|
||||
$(occupancy_wrapper).parent().removeClass('open');
|
||||
// $(occupancy_wrapper).siblings(".booking_guest_occupancy").parent().removeClass('has-error');
|
||||
|
||||
$(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]);
|
||||
} else {
|
||||
// $(occupancy_wrapper).siblings(".booking_guest_occupancy").parent().addClass('has-error');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -630,8 +638,12 @@ function init()
|
||||
var occupancy_block = '';
|
||||
var roomBlockIndex = parseInt($(booking_occupancy_wrapper).find(".occupancy_info_block").last().attr('occ_block_index'));
|
||||
roomBlockIndex += 1;
|
||||
|
||||
|
||||
let max_child_in_room;
|
||||
if ($(this).closest(".booking_occupancy_wrapper").find('.max_children').val()) {
|
||||
max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val();
|
||||
} else {
|
||||
max_child_in_room = window.max_child_in_room;
|
||||
}
|
||||
var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length);
|
||||
countRooms += 1
|
||||
occupancy_block += '<div class="occupancy_info_block col-sm-12" occ_block_index="'+roomBlockIndex+'">';
|
||||
|
||||
48
js/admin/ppreferences.js
Normal file
48
js/admin/ppreferences.js
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
setFrontOccupancyView();
|
||||
$('#PS_FRONT_SEARCH_TYPE').on('change', setFrontOccupancyView);
|
||||
setBackOccupancyView();
|
||||
$('#PS_BACKOFFICE_SEARCH_TYPE').on('change', setBackOccupancyView);
|
||||
|
||||
function setFrontOccupancyView()
|
||||
{
|
||||
if ($('#PS_FRONT_SEARCH_TYPE').val() == SEARCH_TYPE_OWS) {
|
||||
$('#PS_FRONT_OWS_SEARCH_ALGO_TYPE').closest('.form-group').show('fast');
|
||||
$('#PS_FRONT_ROOM_BOOKING_TYPE').closest('.form-group').hide('fast');
|
||||
} else {
|
||||
$('#PS_FRONT_OWS_SEARCH_ALGO_TYPE').closest('.form-group').hide('fast');
|
||||
$('#PS_FRONT_ROOM_BOOKING_TYPE').closest('.form-group').show('fast');
|
||||
}
|
||||
}
|
||||
|
||||
function setBackOccupancyView()
|
||||
{
|
||||
if ($('#PS_BACKOFFICE_SEARCH_TYPE').val() == SEARCH_TYPE_OWS) {
|
||||
$('#PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE').closest('.form-group').show('fast');
|
||||
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').hide('fast');
|
||||
} else {
|
||||
$('#PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE').closest('.form-group').hide('fast');
|
||||
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').show('fast');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
@@ -358,6 +358,7 @@ var ajaxCart = {
|
||||
|
||||
// get the selected extra demands by customer
|
||||
var roomDemands = getRoomsExtraDemands();
|
||||
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@@ -368,7 +369,7 @@ var ajaxCart = {
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true&occupancy=' + JSON.stringify(occupancy) + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)),
|
||||
data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true'+(occupancy_required_for_booking ? '&occupancy=' + JSON.stringify(occupancy) : '&qty=' + occupancy) + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)),
|
||||
success: function(jsonData, textStatus, jqXHR) {
|
||||
/*by webkul checking and setting availability of rooms*/
|
||||
/*for product page add to cart quantity management*/
|
||||
@@ -388,6 +389,8 @@ var ajaxCart = {
|
||||
|
||||
/*for category page add to cart quantity management*/
|
||||
$(callerElement).closest(".room_cont").find(".remain_rm_qty").text(jsonData.avail_rooms);
|
||||
$(callerElement).closest(".room_cont").find('.max_avail_type_qty').val(jsonData.avail_rooms);
|
||||
|
||||
if (jsonData.avail_rooms == 0) {
|
||||
$(callerElement).closest(".room_cont").hide();
|
||||
}
|
||||
@@ -526,6 +529,7 @@ var ajaxCart = {
|
||||
/*for category page add to cart quantity management*/
|
||||
|
||||
$(".room_cont").find('[data-id-product="'+idProduct+'"] .remain_rm_qty').text(jsonData.avail_rooms);
|
||||
$(".room_cont").find('[data-id-product="'+idProduct+'"] .max_avail_type_qty').val(jsonData.avail_rooms);
|
||||
if (jsonData.avail_rooms == 0) {
|
||||
$(".room_cont").find('[data-id-product="'+idProduct+'"]').hide();
|
||||
}
|
||||
@@ -624,6 +628,7 @@ var ajaxCart = {
|
||||
if (pagename == 'category') {
|
||||
// for category page....
|
||||
$('.room_cont[data-id-product="'+idProduct+'"]').find(".remain_rm_qty").text(jsonData.avail_rooms);
|
||||
$('.room_cont[data-id-product="'+idProduct+'"]').find('.max_avail_type_qty').val(jsonData.avail_rooms);
|
||||
|
||||
$('.room_cont[data-id-product="'+idProduct+'"]').show(0, function() {
|
||||
if (jsonData.avail_rooms <= room_warning_num) {
|
||||
@@ -1024,13 +1029,18 @@ var ajaxCart = {
|
||||
let rooms = 0;
|
||||
let adults = 0;
|
||||
let children = 0;
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
children += parseInt(val.children);
|
||||
|
||||
});
|
||||
$('#layer_cart_product_quantity').text(getRoomTypeGuestOccupancyFormated(adults, children, rooms));
|
||||
let room_quantity_text = '';
|
||||
if (occupancy_required_for_booking) {
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
children += parseInt(val.children);
|
||||
});
|
||||
room_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
|
||||
} else {
|
||||
room_quantity_text = product.occupancy;
|
||||
}
|
||||
$('#layer_cart_product_quantity').text(room_quantity_text);
|
||||
|
||||
$('.layer_cart_img').html('<img class="layer_cart_img img-responsive" src="' + product.image + '" alt="' + product.name + '" title="' + product.name + '" />');
|
||||
|
||||
|
||||
@@ -77,10 +77,14 @@ class HotelBookingDetail extends ObjectModel
|
||||
const SEARCH_EXACT_ROOM_TYPE_ALGO = 1;
|
||||
const SEARCH_ALL_ROOM_TYPE_ALGO = 2;
|
||||
|
||||
// Search TYpe: Occupancy wise search, Normal search
|
||||
// Search Type: Occupancy wise search, Normal search
|
||||
const SEARCH_TYPE_OWS = 1;
|
||||
const SEARCH_TYPE_NORMAL = 2;
|
||||
|
||||
//
|
||||
const ROOM_BOOKING_OCCUPANCY_WISE = 1;
|
||||
const ROOM_BOOKING_QUANTITY_WISE = 2;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_booking_detail',
|
||||
'primary' => 'id',
|
||||
|
||||
@@ -448,7 +448,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
) {
|
||||
$chkQty = 0;
|
||||
$num_days = HotelHelper::getNumberOfDays($date_from, $date_to);
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$roomsRequired = count($occupancy);
|
||||
} else {
|
||||
$objRoomType = new HotelRoomType();
|
||||
@@ -472,7 +472,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
$obj_htl_cart_booking_data->extra_demands = $roomDemand;
|
||||
$obj_htl_cart_booking_data->date_from = $date_from;
|
||||
$obj_htl_cart_booking_data->date_to = $date_to;
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$room_occupancy = array_shift($occupancy);
|
||||
$obj_htl_cart_booking_data->adults = $room_occupancy['adults'];
|
||||
$obj_htl_cart_booking_data->children = $room_occupancy['children'];
|
||||
@@ -537,7 +537,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
'id_guest' => $id_guest,
|
||||
);
|
||||
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$roomsRequired = count($occupancy);
|
||||
} else {
|
||||
$roomsRequired = $occupancy;
|
||||
|
||||
@@ -256,10 +256,10 @@ class HotelHelper
|
||||
// Search Fields
|
||||
Configuration::updateValue('PS_FRONT_SEARCH_TYPE', HotelBookingDetail::SEARCH_TYPE_OWS);
|
||||
Configuration::updateValue('PS_FRONT_OWS_SEARCH_ALGO_TYPE', HotelBookingDetail::SEARCH_EXACT_ROOM_TYPE_ALGO);
|
||||
Configuration::updateValue('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING', true);
|
||||
Configuration::updateValue('PS_FRONT_ROOM_BOOKING_TYPE', HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE);
|
||||
Configuration::updateValue('PS_BACKOFFICE_SEARCH_TYPE', HotelBookingDetail::SEARCH_TYPE_OWS);
|
||||
Configuration::updateValue('PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE', HotelBookingDetail::SEARCH_ALL_ROOM_TYPE_ALGO);
|
||||
Configuration::updateValue('PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING', true);
|
||||
Configuration::updateValue('PS_BACKOFFICE_ROOM_BOOKING_TYPE', HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -307,7 +307,12 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
));
|
||||
|
||||
$this->context->smarty->assign('occupancy_required_for_booking', Configuration::get('PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING'));
|
||||
$bookingTypeOccupancy = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$bookingTypeOccupancy = true;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('occupancy_required_for_booking', $bookingTypeOccupancy);
|
||||
|
||||
if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS ) {
|
||||
$this->context->smarty->assign(array(
|
||||
@@ -562,6 +567,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
);
|
||||
if ($opt) {
|
||||
// add room in cart
|
||||
$objRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($id_product);
|
||||
|
||||
$obj_cart_book_data = new HotelCartBookingData();
|
||||
$obj_cart_book_data->id_cart = $id_cart;
|
||||
@@ -575,7 +582,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$obj_cart_book_data->comment = $comment;
|
||||
$obj_cart_book_data->date_from = $date_from;
|
||||
$obj_cart_book_data->date_to = $date_to;
|
||||
if (Configuration::get('PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$room_occupancy = array_shift($occupancy);
|
||||
$obj_cart_book_data->adults = $room_occupancy['adults'];
|
||||
$obj_cart_book_data->children = $room_occupancy['children'];
|
||||
@@ -679,6 +686,10 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
{
|
||||
parent::setMedia();
|
||||
$currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$bookingTypeOccupancy = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
$bookingTypeOccupancy = true;
|
||||
}
|
||||
$jsVars = array(
|
||||
'currency_prefix' => $currency->prefix,
|
||||
'currency_suffix' => $currency->suffix,
|
||||
@@ -689,7 +700,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'occupancy_required_for_booking' => Configuration::get('PS_BACKOFFICE_OCCUPANCY_REQUIRED_FOR_BOOKING'),
|
||||
'occupancy_required_for_booking' => $bookingTypeOccupancy,
|
||||
'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
|
||||
'opt_select_all' => $this->l('All Types'),
|
||||
'slt_another_htl' => $this->l('Select Another Hotel'),
|
||||
|
||||
@@ -268,7 +268,7 @@ $(document).ready(function() {
|
||||
function getBookingOccupancyDetails(bookingform)
|
||||
{
|
||||
let occupancy;
|
||||
if (occupancy_required_for_booking) {
|
||||
if (parseInt(occupancy_required_for_booking)) {
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
if (selected_occupancy.length) {
|
||||
occupancy = [];
|
||||
|
||||
@@ -10,12 +10,10 @@
|
||||
<div id="room_type_{$book_k}" class="tab-pane {if $book_v@first}active{/if}">
|
||||
{* room type occupancy Details *}
|
||||
<div>
|
||||
<h4>{l s='Room Occupancy'}</h4>
|
||||
<ul>
|
||||
<li>{l s='Max adults'} : {$book_v['room_type_info']['max_adults']}</li>
|
||||
<li>{l s='Max children'} : {$book_v['room_type_info']['max_children']}</li>
|
||||
<li>{l s='Max guests'} : {$book_v['room_type_info']['max_guests']}</li>
|
||||
</ul>
|
||||
<div class="form-group">
|
||||
<b>{l s='Room Occupancy'}:</b>
|
||||
<span>{l s='Maximum adults'} : {$book_v['room_type_info']['max_adults']}</span> <span>{l s='Maximum children'} : {$book_v['room_type_info']['max_children']}</span> <span>{l s='Maximum guests'} : {$book_v['room_type_info']['max_guests']}</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Available Rooms' mod='hotelreservationsystem'}</a></li>
|
||||
|
||||
@@ -163,7 +163,7 @@ class WkRoomSearchBlock extends Module
|
||||
$maxOrderDate = Tools::getValue('max_order_date');
|
||||
$maxOrderDate = date('Y-m-d', strtotime($maxOrderDate));
|
||||
|
||||
if (Configuration::get('PS_FRONT_OCCUPANCY_REQUIRED_FOR_BOOKING')) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_BOOKING_TYPE') == HotelBookingDetail::ROOM_BOOKING_OCCUPANCY_WISE) {
|
||||
if ($occupancy = Tools::getValue('occupancy')) {
|
||||
$urlData['occupancy'] = $occupancy;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
{**
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<div class="form-group dropdown">
|
||||
<button class="form-control booking_guest_occupancy input-occupancy{if isset($error) && $error == 1} error_border{/if}" type="button">
|
||||
<span class="">
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
<div class="rm_qty_cont clearfix">
|
||||
{**
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<div class="rm_qty_cont clearfix">
|
||||
<input type="hidden" class="text-center form-control quantity_wanted" min="1" name="qty" value="{if isset($quantity) && $quantity}{$quantity|escape:'html':'UTF-8'}{else}1{/if}">
|
||||
<input type="hidden" class="max_avail_type_qty" value="{if isset($total_available_rooms)} {$total_available_rooms|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="qty_count pull-left">
|
||||
|
||||
@@ -66,7 +66,9 @@
|
||||
{include file="./quantity_field.tpl" total_available_rooms=$room_v['room_left']}
|
||||
</div>
|
||||
{/if}
|
||||
<a cat_rm_check_in="{$booking_date_from|escape:'htmlall':'UTF-8'}" cat_rm_check_out="{$booking_date_to|escape:'htmlall':'UTF-8'}" href="" rm_product_id="{$room_v['id_product']}" cat_rm_book_nm_days="{$num_days|escape:'htmlall':'UTF-8'}" data-id-product-attribute="0" data-id-product="{$room_v['id_product']|intval}" class="btn btn-default button button-medium ajax_add_to_cart_button"><span>{l s='Book Now'}</span></a>
|
||||
<div>
|
||||
<a cat_rm_check_in="{$booking_date_from|escape:'htmlall':'UTF-8'}" cat_rm_check_out="{$booking_date_to|escape:'htmlall':'UTF-8'}" href="" rm_product_id="{$room_v['id_product']}" cat_rm_book_nm_days="{$num_days|escape:'htmlall':'UTF-8'}" data-id-product-attribute="0" data-id-product="{$room_v['id_product']|intval}" class="btn btn-default button button-medium ajax_add_to_cart_button"><span>{l s='Book Now'}</span></a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -266,6 +266,7 @@ p.capa_txt {
|
||||
.booking_room_fields {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: end;
|
||||
justify-content: end;
|
||||
gap: 15px 10px;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
height: 37px;
|
||||
border-radius: 4px;
|
||||
padding: 3px 5px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
border: 1px solid #E1E3E7;
|
||||
|
||||
@@ -358,6 +358,7 @@ var ajaxCart = {
|
||||
|
||||
// get the selected extra demands by customer
|
||||
var roomDemands = getRoomsExtraDemands();
|
||||
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@@ -368,7 +369,7 @@ var ajaxCart = {
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true&occupancy=' + JSON.stringify(occupancy) + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)),
|
||||
data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true'+(occupancy_required_for_booking ? '&occupancy=' + JSON.stringify(occupancy) : '&qty=' + occupancy) + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)),
|
||||
success: function(jsonData, textStatus, jqXHR) {
|
||||
/*by webkul checking and setting availability of rooms*/
|
||||
/*for product page add to cart quantity management*/
|
||||
@@ -388,6 +389,8 @@ var ajaxCart = {
|
||||
|
||||
/*for category page add to cart quantity management*/
|
||||
$(callerElement).closest(".room_cont").find(".remain_rm_qty").text(jsonData.avail_rooms);
|
||||
$(callerElement).closest(".room_cont").find('.max_avail_type_qty').val(jsonData.avail_rooms);
|
||||
|
||||
if (jsonData.avail_rooms == 0) {
|
||||
$(callerElement).closest(".room_cont").hide();
|
||||
}
|
||||
@@ -526,6 +529,7 @@ var ajaxCart = {
|
||||
/*for category page add to cart quantity management*/
|
||||
|
||||
$(".room_cont").find('[data-id-product="'+idProduct+'"] .remain_rm_qty').text(jsonData.avail_rooms);
|
||||
$(".room_cont").find('[data-id-product="'+idProduct+'"] .max_avail_type_qty').val(jsonData.avail_rooms);
|
||||
if (jsonData.avail_rooms == 0) {
|
||||
$(".room_cont").find('[data-id-product="'+idProduct+'"]').hide();
|
||||
}
|
||||
@@ -624,6 +628,7 @@ var ajaxCart = {
|
||||
if (pagename == 'category') {
|
||||
// for category page....
|
||||
$('.room_cont[data-id-product="'+idProduct+'"]').find(".remain_rm_qty").text(jsonData.avail_rooms);
|
||||
$('.room_cont[data-id-product="'+idProduct+'"]').find('.max_avail_type_qty').val(jsonData.avail_rooms);
|
||||
|
||||
$('.room_cont[data-id-product="'+idProduct+'"]').show(0, function() {
|
||||
if (jsonData.avail_rooms <= room_warning_num) {
|
||||
@@ -1024,13 +1029,18 @@ var ajaxCart = {
|
||||
let rooms = 0;
|
||||
let adults = 0;
|
||||
let children = 0;
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
children += parseInt(val.children);
|
||||
|
||||
});
|
||||
$('#layer_cart_product_quantity').text(getRoomTypeGuestOccupancyFormated(adults, children, rooms));
|
||||
let room_quantity_text = '';
|
||||
if (occupancy_required_for_booking) {
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
children += parseInt(val.children);
|
||||
});
|
||||
room_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
|
||||
} else {
|
||||
room_quantity_text = product.occupancy;
|
||||
}
|
||||
$('#layer_cart_product_quantity').text(room_quantity_text);
|
||||
|
||||
$('.layer_cart_img').html('<img class="layer_cart_img img-responsive" src="' + product.image + '" alt="' + product.name + '" title="' + product.name + '" />');
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
$(document).on('click', '.booking_guest_occupancy', function(e) {
|
||||
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
|
||||
$(this).parent().toggleClass('open');
|
||||
});
|
||||
|
||||
@@ -294,7 +295,6 @@ function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
|
||||
children += parseInt($(this).val());
|
||||
});
|
||||
guestButtonVal = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
|
||||
// console.log($(booking_occupancy_wrapper).siblings('.booking_guest_occupancy > span'));
|
||||
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user