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.3 KB
Raw Blame
@model ProductDetailsModel

@if (Model.ProductWarehouses.Any())
{
    <div>
        <label for="warehouseId" class="col-form-label">@Loc["Products.Warehouse"]:</label>
        <select class="form-select form-control" name="WarehouseId" id="WarehouseId">
            @foreach (var warehouse in Model.ProductWarehouses)
            {
                <option selected="@(warehouse.Selected)" value="@warehouse.WarehouseId">@(warehouse.Name)</option>
            }
        </select>
    </div>
    @*One island either way. The view used to branch on whether the product has
        attributes and register a different handler in each branch; the module
        covers both - it refreshes availability and, when there is an attribute
        view-model, asks it to reprice.*@
    <script type="application/json" data-grand-vm="warehouseSelector">@Json.Serialize(new {
                                                                          productId = Model.Id,
                                                                          route = Url.Action("productdetails_warehousechange", "product"),
                                                                          elements = new { selectId = "WarehouseId" }
                                                                      })</script>
}