Skip to content

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.

3.3 KB
Raw Blame
@model CustomerOrderListModel
@inject IPageHeadBuilder pagebuilder
@inject IContextAccessor contextAccessor
@{
    Layout = "_TwoColumns";

    var supportRtl = contextAccessor.WorkContext.WorkingLanguage.Rtl;

    //title
    pagebuilder.AddTitleParts(Loc["Title.Account"]);
}

@section left
{
    @await Component.InvokeAsync("CustomerNavigation", new { selectedTabId = AccountNavigationEnum.Orders })
}

<div class="page account-page order-list-page ps-lg-3 pt-lg-0 pt-3">
    <h1 class="generalTitle h2">@Loc["Account.CustomerOrders"]</h1>
    @if (Model.Orders.Any())
    {
        <div class="account-order table-responsive">
            <table class="table hover-table">
                <thead>
                <tr>
                    <th scope="col">@Loc["Account.CustomerOrders.OrderNumber"]</th>
                    <th scope="col">@Loc["Account.CustomerOrders.OrderStatus"]</th>
                    <th scope="col">@Loc["Account.CustomerOrders.OrderDate"]</th>
                    <th scope="col">@Loc["Account.CustomerOrders.OrderTotal"]</th>
                    <th scope="col"></th>
                </tr>
                </thead>
                <tbody>
                @foreach (var order in Model.Orders)
                {
                    <tr>
                        <td>
                            <span>@order.OrderNumber</span>
                        </td>
                        <td>
                            <span class="@order.OrderStatus.ToLower() badge status order-status">@order.OrderStatus</span>
                        </td>
                        @if (supportRtl)
                        {
                            <td>
                                <span>@Convert.ToDateTime(order.CreatedOn).ToString("tt HH:mm yyyy/MM/dd")</span>
                            </td>
                        }
                        else
                        {
                            <td>
                                <span>@order.CreatedOn.ToString("g")</span>
                            </td>
                        }
                        <td>
                            <span class="order-total">@order.OrderTotal</span>
                        </td>
                        <td>
                            <div class="buttons d-flex flex-column">
                                <input type="button" value="@Loc["Account.CustomerOrders.OrderDetails"]" class="btn btn-sm btn-info order-details-button" onclick="location = ('@Url.RouteUrl("OrderDetails", new { orderId = order.Id })')"/>
                                @if (order.IsMerchandiseReturnAllowed)
                                {
                                    <input type="button" value="@Loc["Account.CustomerOrders.ReturnItems"]" class="btn btn-sm btn-warning text-white return-items-button mt-1" onclick="location = ('@Url.RouteUrl("MerchandiseReturn", new { orderId = order.Id })')"/>
                                }
                            </div>
                        </td>
                    </tr>
                }
                </tbody>
            </table>
        </div>
        <page-navigation asp-query-param="pagenumber" asp-pagination="Model.PagingContext"/>
    }
    else
    {
        <div class="no-data alert alert-info">
            @Loc["Account.CustomerOrders.NoOrders"]
        </div>
    }
</div>