@using System.Text.Encodings.Web;
@{

    //success messages
    var successMessages = new List<string>();
    if (TempData[string.Format("Grand.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(TempData[string.Format("Grand.notifications.{0}", NotifyType.Success)] as IList<string>);
    }
    if (ViewData[string.Format("Grand.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(ViewData[string.Format("Grand.notifications.{0}", NotifyType.Success)] as IList<string>);
    }

    //error messages
    var errorMessages = new List<string>();
    if (TempData[string.Format("Grand.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(TempData[string.Format("Grand.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
    if (ViewData[string.Format("Grand.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(ViewData[string.Format("Grand.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
}
@foreach (var message in successMessages)
{
    <script asp-location="Footer" asp-order="901">
        vm.displayBarNotification('@Html.Raw(JavaScriptEncoder.Default.Encode(message))','', 'success', 3500);
    </script>
}
@foreach (var message in errorMessages)
{
    <script asp-location="Footer" asp-order="901">
        vm.displayBarNotification('@Html.Raw(JavaScriptEncoder.Default.Encode(message))','', 'error', 3500);
    </script>
}

<div id="bar-notification" class="generalNote"></div>
<div class="modal-place"></div>
<partial name="Partials/PopupAddToCart" />
<partial name="Partials/ProductQuickView" />
