Skip to content

Commit 94d8e35

Browse files
committed
πŸ“ Clarify pre-chat conditions help text for better UX
- πŸ“‹ Add evaluation order explanation (maintenance β†’ online β†’ offline β†’ disable) so admins understand precedence rules - πŸ”€ Document how AND/OR logic operators combine conditions within each block - 🌐 Expand online conditions description: fallback behavior when conditions aren't met - πŸ“΄ Rewrite offline conditions help: clarify it only triggers when enabled, wins over online, and can target specific visitors (e.g., by country) - ⚠️ Note that offline mode only changes widget UI and doesn't block chats β€” suggest disable conditions for blocking - 🚫 Improve disable conditions description: clarify execution order and offline precedence - 🌍 Wrap previously hardcoded English strings in translation function for localization support
1 parent 689fd9e commit 94d8e35

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

β€Žlhc_web/design/defaulttheme/tpl/lhchat/startchatformsettings/prechatconditions.tpl.phpβ€Ž

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
</ul>
1515
</p>
1616
<hr>
17-
<p>
17+
18+
<p class="mb-1"><small class="text-muted"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Evaluation order: maintenance mode, online conditions, offline conditions, disable conditions. Offline and disable modes take precedence over online - offline mode wins as soon as offline conditions are set. If the online conditions are not met and neither offline nor disable mode matches, the widget is hidden.')?></small><br/>
19+
<small class="text-muted"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Inside each block rows are joined with AND; selecting OR in a row starts an alternative group. The preview under every block shows the resulting logic.')?></small></p>
20+
21+
<p class="mb-1">
1822
<strong><a href="#" onclick="lhc.revealModal({'url':WWW_DIR_JAVASCRIPT+'genericbot/help/preconditions'});" class="material-icons text-muted">help</a><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Online conditions')?>:</strong>
1923
<br>
20-
<small><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','If these conditions are met widget will become online')?></small>
24+
<small><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Checked first. The widget is shown as online when these conditions are met. With no online conditions the widget is always online. If they are not met, the widget falls through to offline conditions, then to disable conditions, and is hidden if neither of them matches.')?></small>
2125
</p>
2226
<button type="button" class="btn btn-outline-secondary btn-xs" ng-click="preconditions.addField('online')"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Add condition')?></button><span class="text-muted ps-2"><small><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','conditions are optional')?>.</small></span>
2327

@@ -73,7 +77,9 @@
7377

7478

7579
<p class="mb-1"><strong><a href="#" onclick="lhc.revealModal({'url':WWW_DIR_JAVASCRIPT+'genericbot/help/preconditions'});" class="material-icons text-muted">help</a>Offline conditions:</strong><br>
76-
<small><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Make widget offline if widget is not in oline mode')?></small>
80+
<small><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Checked after the online conditions and only when offline mode is enabled. The widget switches to offline mode (leave a message form) when these conditions are met. Use them also to show the offline form to visitors who did not match the online conditions. If online and offline conditions match at the same time, offline mode wins. With no offline conditions enabled offline mode applies to every visitor who failed the online conditions.')?></small><br/>
81+
<small class="text-muted"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Because offline mode wins over online as soon as offline conditions are set, use only this block to make the widget offline for specific visitors, e.g. specific countries (leave online conditions empty). Example: field {args.online_user.user_country_code}, comparator one of, value us,ca,gb - the widget is then offline for these countries only. Codes are lowercase two letter codes and require geo detection to be enabled.')?></small><br/>
82+
<small class="text-muted"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Offline mode only changes the widget UI, it does not block starting a chat for these visitors. Use disable conditions with the same rule if the chat has to be blocked.')?></small>
7783
</p>
7884
<label class="d-block"><input type="checkbox" value="on" ng-model="preconditions.conditions.offline_enabled" name="prec_enable_offline" /> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Enable offline mode');?></label>
7985
<div ng-show="preconditions.conditions.offline_enabled">
@@ -128,7 +134,7 @@
128134
<hr>
129135

130136
<p class="mb-1"><strong><a href="#" onclick="lhc.revealModal({'url':WWW_DIR_JAVASCRIPT+'genericbot/help/preconditions'});" class="material-icons text-muted">help</a>Disable conditions.</strong><br>
131-
<small>If widget is not in online/offline mode after online conditions check. We will show a custom message once they open a widget.</small>
137+
<small><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Checked after the online and offline conditions, and only when disable mode is enabled. If the visitor did not match the online conditions or matches these conditions, we will show the custom message once they open the widget. Offline mode takes precedence over disable mode. Without a message the widget is hidden instead.')?></small>
132138
</p>
133139
<label class="d-block"><input type="checkbox" value="on" ng-model="preconditions.conditions.disable_enabled" name="prec_enable_disable" /> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Enable disable mode');?></label>
134140
<div ng-show="preconditions.conditions.disable_enabled">

0 commit comments

Comments
Β (0)