fix quantity change issue on room type page booking form

This commit is contained in:
Shreesh Arora
2023-04-13 20:19:31 +05:30
parent 4d19a54d1a
commit 973fc64327
2 changed files with 13 additions and 6 deletions

View File

@@ -593,7 +593,11 @@ class ProductControllerCore extends FrontController
$quantity = count($occupancy);
} else {
// when room selection is done using qty, occupancy parameter will contain the number of rooms.
$quantity = $occupancy;
if (is_array($occupancy)) {
$quantity = 1;
} else {
$quantity = $occupancy;
}
}
if ($quantity <= 0) {
@@ -1222,8 +1226,10 @@ class ProductControllerCore extends FrontController
$dateFrom = Tools::getValue('date_from');
$dateTo = Tools::getValue('date_to');
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
}
$roomTypeDemands = Tools::getValue('room_type_demands');
$roomServiceProducts = Tools::getValue('room_service_products');

View File

@@ -619,9 +619,10 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$date_from = Tools::getValue('date_from');
$date_to = Tools::getValue('date_to');
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
$date_from = date("Y-m-d", strtotime($date_from));
$date_to = date("Y-m-d", strtotime($date_to));