disable services adding option when rooms are unavailable

This commit is contained in:
Shreesh Arora
2023-04-05 10:51:57 +05:30
parent 2f3f616b95
commit fceefbb6e5
3 changed files with 22 additions and 0 deletions

View File

@@ -1255,6 +1255,16 @@ function disableRoomTypeDemands(show) {
}
}
function disableRoomTypeServices(disable) {
if (disable) {
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
$('#service_products_cont').find('button.add_roomtype_product').removeAttr('disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').removeAttr('disabled');
}
}
function getRoomsExtraDemands()
{
var roomDemands = [];

View File

@@ -1255,6 +1255,16 @@ function disableRoomTypeDemands(show) {
}
}
function disableRoomTypeServices(disable) {
if (disable) {
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
$('#service_products_cont').find('button.add_roomtype_product').removeAttr('disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').removeAttr('disabled');
}
}
function getRoomsExtraDemands()
{
var roomDemands = [];

View File

@@ -1350,8 +1350,10 @@ var BookingForm = {
}
if (!$('.max_avail_type_qty').length || $('.max_avail_type_qty').val() < 1) {
disableRoomTypeDemands(1);
disableRoomTypeServices(1);
} else {
disableRoomTypeDemands(0);
disableRoomTypeServices(0);
}
},
initDatepicker: function(max_order_date, preparation_time, dateFrom, dateTo) {