Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
@using System.Text.Encodings.Web
@{
//success messages
var successMessages = new List<string>();
if (TempData[$"Grand.notifications.{NotifyType.Success}"] != null)
{
successMessages.AddRange(TempData[$"Grand.notifications.{NotifyType.Success}"] as IList<string>);
}
if (ViewData[$"Grand.notifications.{NotifyType.Success}"] != null)
{
successMessages.AddRange(ViewData[$"Grand.notifications.{NotifyType.Success}"] as IList<string>);
}
//error messages
var errorMessages = new List<string>();
if (TempData[$"Grand.notifications.{NotifyType.Error}"] != null)
{
errorMessages.AddRange(TempData[$"Grand.notifications.{NotifyType.Error}"] as IList<string>);
}
if (ViewData[$"Grand.notifications.{NotifyType.Error}"] != null)
{
errorMessages.AddRange(ViewData[$"Grand.notifications.{NotifyType.Error}"] as IList<string>);
}
}
@{
var barMessages = successMessages.Select(text => new { text, variant = "success" })
.Concat(errorMessages.Select(text => new { text, variant = "error" }))
.ToList();
}
@if (barMessages.Any())
{
@*One island for the lot, instead of a script tag per message escaped into a
JS string literal. Behaviour: vueapp/src/behaviours/bar-notifications.js*@
<script type="application/json" data-grand-vm="barNotifications">@Json.Serialize(new { messages = barMessages })</script>
}
<div id="bar-notification" class="generalNote"></div>
<div class="modal-place"></div>
<partial name="Partials/PopupAddToCart"/>
<partial name="Partials/ProductQuickView"/>