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
@model ShippingMethodRestrictionModel
<admin-card>
<div class="note note-info">
@Loc["Admin.Configuration.Shipping.Restrictions.DescriptionCountry"]
</div>
@if (Model.AvailableCountries.Count == 0)
{
<text>No countries defined</text>
}
else if (Model.AvailableShippingMethods.Count == 0)
{
<text>No shipping methods available</text>
}
else
{
<script>
$(document).ready(function () {
@foreach (var sm in Model.AvailableShippingMethods)
{
<text>
$('#selectall-@(sm.Id)').click(function () {
$('.restrict_@(sm.Id)').prop('checked', $(this).is(':checked')).change();
});
</text>
}
});
</script>
<div class="table-responsive">
<table class="table table-sm table-hover align-middle mb-0">
<tbody>
<tr>
<th scope="col">
<strong>@Loc["Admin.Configuration.Shipping.Restrictions.Country"]</strong>
</th>
@foreach (var sm in Model.AvailableShippingMethods)
{
<th scope="col" class="text-center">
<strong>@sm.Name</strong>
<br/>
<input class="form-check-input" type="checkbox" id="selectall-@(sm.Id)"/>
</th>
}
</tr>
@foreach (var c in Model.AvailableCountries)
{
<tr>
<td>
<span>@c.Name</span>
</td>
@foreach (var sm in Model.AvailableShippingMethods)
{
var restricted = Model.Restricted.ContainsKey(c.Id) && Model.Restricted[c.Id][sm.Id];
var checkedValue = restricted ? "checked" : null;
<td class="text-center">
<input id="restrict_@(sm.Id)" class="restrict_@(sm.Id) form-check-input" type="checkbox" value="@(c.Id)" name="restrict_@(sm.Id)" @checkedValue />
</td>
}
</tr>
}
</tbody>
</table>
</div>
}
</admin-card>