diff --git a/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php b/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php
index 2091f44..a3b19b6 100644
--- a/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php
+++ b/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php
@@ -1476,6 +1476,7 @@ function ifnex_icon($name, $size = 20) {
'truck' => '',
'check' => '',
'clock' => '',
+ 'bell' => '',
];
$path = $icons[$name] ?? $icons['dashboard'];
@@ -1503,7 +1504,7 @@ function ifnex_customer_dashboard_shortcode($atts) {
}
$tab = sanitize_key($_GET['tab'] ?? 'dashboard');
- $allowed_tabs = ['dashboard', 'orders', 'new-order', 'wallet', 'transactions', 'tracking', 'profile'];
+ $allowed_tabs = ['dashboard', 'notifications', 'orders', 'new-order', 'wallet', 'transactions', 'tracking', 'profile'];
if (!in_array($tab, $allowed_tabs)) $tab = 'dashboard';
$bridge = new IFNEX_User_Bridge();
@@ -1517,6 +1518,13 @@ function ifnex_customer_dashboard_shortcode($atts) {
$stats = $profile['stats'] ?? [];
}
+ // تعداد اعلانهای خواندهنشده برای badge سایدبار
+ $unread_notifications = 0;
+ $notif_count_result = $bridge->get_notifications($user_id, 1);
+ if (!is_wp_error($notif_count_result) && isset($notif_count_result['unread_count'])) {
+ $unread_notifications = (int) $notif_count_result['unread_count'];
+ }
+
$recent_orders = [];
if ($tab === 'dashboard') {
$orders_result = $bridge->get_customer_orders($user_id, 3);
@@ -1526,6 +1534,7 @@ function ifnex_customer_dashboard_shortcode($atts) {
$base_url = get_permalink();
$menu_items = [
'dashboard' => ['icon' => 'dashboard', 'label' => 'داشبورد'],
+ 'notifications'=> ['icon' => 'bell', 'label' => 'اعلانها'],
'orders' => ['icon' => 'orders', 'label' => 'سفارشات من'],
'new-order' => ['icon' => 'plus', 'label' => 'ثبت سفارش جدید'],
'wallet' => ['icon' => 'wallet', 'label' => 'کیف پول'],
@@ -1535,12 +1544,13 @@ function ifnex_customer_dashboard_shortcode($atts) {
];
$tab_titles = [
- 'dashboard' => 'داشبورد', 'orders' => 'سفارشات من', 'new-order' => 'ثبت سفارش جدید',
+ 'dashboard' => 'داشبورد', 'notifications' => 'اعلانها', 'orders' => 'سفارشات من', 'new-order' => 'ثبت سفارش جدید',
'wallet' => 'کیف پول', 'transactions' => 'تراکنشها', 'tracking' => 'رهگیری مرسوله', 'profile' => 'پروفایل',
];
ob_start();
?>
+