Webiant Logo Webiant Logo
  1. No results found.

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

Default.cshtml

@model MiniShoppingCartModel

@using Nop.Core.Domain.Catalog

<div id="flyout-cart" class="flyout-cart">
    <div class="mini-shopping-cart">
        <div class="count">
            @if (Model.TotalProducts == 0)
            {
                @T("ShoppingCart.Mini.NoItems")
            }
            else
            {
                @Html.Raw(string.Format(T("ShoppingCart.Mini.ItemsText").Text, $"<a href=\"{Url.RouteUrl(NopRouteNames.General.CART)}\">{string.Format(T("ShoppingCart.Mini.Items").Text, Model.TotalProducts)}</a>"))
            }
        </div>
        @if (Model.TotalProducts > 0)
        {
            <div class="items">
                @for (var i = 0; i < Model.Items.Count; i++)
                {
                    var item = Model.Items[i];
                    <div class="item @(i == 0 ? "first" : null)">
                        @if (Model.ShowProductImages)
                        {
                            <div class="picture">
                                <a href="@(await NopUrl.RouteGenericUrlAsync<Product>(new { SeName = item.ProductSeName }))" title="@item.Picture.Title">
                                    <img alt="@item.Picture.AlternateText" src="@item.Picture.ImageUrl" title="@item.Picture.Title" />
                                </a>
                            </div>
                        }
                        <div class="product">
                            <div class="name">
                                <a href="@(await NopUrl.RouteGenericUrlAsync<Product>(new { SeName = item.ProductSeName }))">@item.ProductName</a>
                            </div>
                            @if (!string.IsNullOrEmpty(item.AttributeInfo))
                            {
                                <div class="attributes">
                                    @Html.Raw(item.AttributeInfo)
                                </div>
                            }
                            <div class="price">@T("ShoppingCart.Mini.UnitPrice"): <span>@item.UnitPrice</span></div>
                            <div class="quantity">@T("ShoppingCart.Mini.Quantity"): <span>@item.Quantity</span></div>
                        </div>
                    </div>
                }
            </div>
            <div class="totals">@T("ShoppingCart.Totals.SubTotal"): <strong>@Model.SubTotal</strong></div>
            <div class="buttons">
                @if (Model.DisplayShoppingCartButton)
                {
                    <button type="button" class="button-1 cart-button" onclick="setLocation('@(Url.RouteUrl(NopRouteNames.General.CART))')">@T("ShoppingCart.Mini.ViewCart")</button>
                }
                @if (Model.DisplayCheckoutButton)
                {
                    var checkoutUrl = "";
                    if (Model.AnonymousCheckoutAllowed && Model.CurrentCustomerIsGuest)
                    {
                        checkoutUrl = Url.RouteUrl(NopRouteNames.Standard.LOGIN_CHECKOUT_AS_GUEST, new { returnUrl = Url.RouteUrl(NopRouteNames.General.CART) });
                    }
                    else
                    {
                        checkoutUrl = Url.RouteUrl(NopRouteNames.Standard.CHECKOUT);
                    }
                    <button type="button" class="button-1 checkout-button" onclick="setLocation('@checkoutUrl')">@T("Checkout.Button")</button>
                }
            </div>
        }
    </div>
</div>