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.

1.4 KB
Raw Blame
@model CollectionModel
<partial name="Partials/WidgetZone.Discounts.Top" model="Model"/>
@* the discount list of the product Prices tab: one check per discount, two to a row *@
@if (Model.AvailableDiscounts is { Count: > 0 })
{
    <admin-card>
        <div class="grand-fields grand-fields--2col">
            @foreach (var discount in Model.AvailableDiscounts)
            {
                <div class="grand-field grand-field--check form-check">
                    <div class="grand-field__control">
                        <input type="checkbox" class="form-check-input" id="[email protected]" name="SelectedDiscountIds" value="@discount.Id"
                               checked="@(Model.SelectedDiscountIds != null && Model.SelectedDiscountIds.Contains(discount.Id))"/>
                    </div>
                    <label class="grand-field__label" for="[email protected]">@discount.Name</label>
                </div>
            }
        </div>
    </admin-card>
}
else
{
    <div class="note note-info">
        @* the Admin text links to /Admin/Discount/List, which a store manager cannot open *@
        @if (ViewContext.RouteData.Values["area"] as string == "Store")
        {
            @Loc["Admin.Catalog.Discounts.NoStoreDiscounts"]
        }
        else
        {
            @Html.Raw(Loc["Admin.Catalog.Collections.Discounts.NoDiscounts"])
        }
    </div>
}
<partial name="Partials/WidgetZone.Discounts.Bottom" model="Model"/>