Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

_Notifications.cshtml

@using Newtonsoft.Json
@using Nop.Core.Domain.Messages
@using Nop.Services.Messages
@inject MessagesSettings messagesSettings
@{
    var successMessages = new List();
    var errorMessages = new List();
    var warningMessages = new List();

    //Get messages from TempData
    var notes = TempData.ContainsKey(NopMessageDefaults.NotificationListKey)
        ? JsonConvert.DeserializeObject>(TempData[NopMessageDefaults.NotificationListKey].ToString())
        : null;

    if (notes != null)
    {
        foreach (var note in notes)
        {
            switch (note.Type)
            {
                case NotifyType.Success:
                    successMessages.Add(note.Message);
                    break;
                case NotifyType.Error:
                    errorMessages.Add(note.Message);
                    break;
                case NotifyType.Warning:
                    warningMessages.Add(note.Message);
                    break;

            }
        }
    }
}
@if (successMessages.Any() || warningMessages.Any() || errorMessages.Any())
{
    if (messagesSettings.UsePopupNotifications)
    {
        
    }
    else
    {
        
    }
}





@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.Notifications })