Notifications in Venddor IO serve as an integral feedback mechanism, displayed as pop-up rectangles at the screen's top-right corner. They provide users with instant updates, alerts, or confirmations based on their actions or system responses.
Venddor IO classifies notifications into five distinct categories:
The visual representation of these notifications is controlled by the CSS specific to the area where the notification is triggered.
Notifications in Venddor IO are generated using the fn_set_notification function. Typically, an empty container is embedded within every Venddor IO page's HTML code, where the notification block materializes if a notification is triggered. This container is set up via templates found in:
/backend/templates/common/notification.tpl/themes/[theme name]/templates/common/notification.tplThis is initiated when a page is loaded. For example, in an 'add_to_cart' mode, the notification function might be invoked to display a warning:
if ($mode == 'add_to_cart') {
fn_set_notification('E', fn_get_lang_var('warning'), $msg, true, 'insecure_password');
}
After invoking, the notification details are added to a specific array. When processed, this array determines which notification type gets displayed.
AJAX-based notifications cater to dynamic updates without needing to reload the entire page. Here's how it works:
<div class="cm-notification-container"> is created when a page is displayed. This can either be empty or preloaded with standard notifications.if (defined('AJAX_REQUEST')) {
fn_set_notification('E', fn_get_lang_var('warning'), $msg, true, 'insecure_password');
}
On script completion or an explicit exit(), the Ajax class's destructor is triggered. It subsequently processes the notification details, presenting them via JavaScript functions.
Notifications can also be manually set using JavaScript. For example:
$.ceNotification('show', {
type: 'E',
title: _.error,
message: error_msg
});