diff --git a/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl b/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl index d7da999e3..a6866f2a7 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl @@ -97,7 +97,7 @@

diff --git a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl index 8a41e9221..8f44de792 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl @@ -286,6 +286,8 @@ {/if} + {* keep the block visible when rules are already saved, so they are not hidden from the admin *} + {if $total_room_types > 1 || $product_rule_groups|@count}

diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index d4e0bbee8..576db0d24 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -831,6 +831,10 @@ class AdminCartRulesControllerCore extends AdminController $product_rule_groups = $this->getProductRuleGroupsDisplay($current_object); + // Room type restriction is useful only when there is more than one room type to choose from + $objHotelRoomType = new HotelRoomType(); + $total_room_types = count($objHotelRoomType->getAllRoomTypes()); + $attribute_groups = AttributeGroup::getAttributesGroups($this->context->language->id); $currencies = Currency::getCurrencies(false, true, true); $languages = Language::getLanguages(); @@ -901,6 +905,7 @@ class AdminCartRulesControllerCore extends AdminController 'cart_rules' => $cart_rules, 'product_rule_groups' => $product_rule_groups, 'product_rule_groups_counter' => count($product_rule_groups), + 'total_room_types' => $total_room_types, 'attribute_groups' => $attribute_groups, 'currentIndex' => self::$currentIndex, 'currentToken' => $this->token,