{l s='Below, enter the base occupancy of this room type.'}
+
{l s='Note'}: {l s='Minimum 1 adult is madatory in the base occupancy of the room type'}
@@ -35,7 +36,7 @@
-
+
@@ -46,7 +47,7 @@
-
+
@@ -67,7 +68,7 @@
-
+
@@ -78,7 +79,7 @@
-
+
@@ -89,7 +90,7 @@
-
+
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index 21bba9ce7..799be06a7 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -3272,22 +3272,26 @@ class AdminProductsControllerCore extends AdminController
$this->errors[] = Tools::displayError('Invalid base children');
} else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
if ($baseChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
- $this->errors[] = sprintf(Tools::displayError('Base children cannot be greater than max childern allowed on your website (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'));
+ $this->errors[] = sprintf(Tools::displayError('Base children cannot be greater than max childern allowed in the room of this room type (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'));
}
}
if (!$maxAdults || !Validate::isUnsignedInt($maxAdults)) {
$this->errors[] = Tools::displayError('Invalid maximum number of adults');
} elseif ($maxAdults < $baseAdults) {
$this->errors[] = Tools::displayError('Maximum number of adults cannot be less than base adults');
+ } elseif ($maxAdults > $maxGuests) {
+ $this->errors[] = Tools::displayError('Maximum number of adults cannot be more than maximum number of guests');
}
if ($maxChildren == '' || !Validate::isUnsignedInt($maxChildren)) {
$this->errors[] = Tools::displayError('Invalid maximum number of children');
- } else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
- if ($maxChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
- $this->errors[] = sprintf(Tools::displayError('Maximum number of children cannot be greater than max childern allowed on your website (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'));
- }
} elseif ($maxChildren < $baseChildren) {
$this->errors[] = Tools::displayError('Maximum number of children cannot be less than base children');
+ } elseif ($maxChildren >= $maxGuests) {
+ $this->errors[] = Tools::displayError('Maximum number of children cannot be more or equal than maximum number of guests.(1 adult is mandatory in a room)');
+ } else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
+ if ($maxChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
+ $this->errors[] = sprintf(Tools::displayError('Maximum number of children cannot be greater than max childern allowed in the room of this room type (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'));
+ }
}
if (!$maxGuests || !Validate::isUnsignedInt($maxGuests)) {
$this->errors[] = Tools::displayError('Invalid maximum number of guests');