ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/Setting/ShoppingCart.cshtml
@model ShoppingCartSettingsModel
@{
    //page title
    ViewBag.Title = T("Admin.Configuration.Settings.ShoppingCart").Text;
}
<form asp-area="@Constants.AreaAdmin" asp-controller="Setting" asp-action="ShoppingCart" method="post">
    
    <div asp-validation-summary="All"></div>
    <div class="row">
        <div class="col-md-12">
            <div class="x_panel light form-fit">
                <div class="x_title">
                    <div class="caption">
                        <i class="fa fa-fw fa-sliders"></i>
                        @T("Admin.Configuration.Settings.ShoppingCart")
                    </div>
                    <div class="actions">
                        <div class="btn-group btn-group-devided">
                            <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> @T("Admin.Common.Save") </button>
                        </div>
                    </div>
                    <vc:admin-widget widget-zone="shopping_cart_settings_buttons" additional-data="null" />
                </div>
                <div class="x_content">
                    <div class="form-horizontal">
                        <div class="form-body">
                            @await Component.InvokeAsync("StoreScopeConfiguration")
                        </div>
                    </div>
                </div>
                <div class="x_content form">
                    <vc:admin-widget widget-zone="shopping_cart_settings_top" additional-data="null" />
                    <div class="form-horizontal">
                        <div class="form-body">
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.DisplayCartAfterAddingProduct_OverrideForStore, model => model.DisplayCartAfterAddingProduct, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="DisplayCartAfterAddingProduct" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="DisplayCartAfterAddingProduct" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="DisplayCartAfterAddingProduct"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.DisplayWishlistAfterAddingProduct_OverrideForStore, model => model.DisplayWishlistAfterAddingProduct, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="DisplayWishlistAfterAddingProduct" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="DisplayWishlistAfterAddingProduct" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="DisplayWishlistAfterAddingProduct"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.AllowOutOfStockItemsToBeAddedToWishlist_OverrideForStore, model => model.AllowOutOfStockItemsToBeAddedToWishlist, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="AllowOutOfStockItemsToBeAddedToWishlist" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="AllowOutOfStockItemsToBeAddedToWishlist" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="AllowOutOfStockItemsToBeAddedToWishlist"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.MaximumShoppingCartItems_OverrideForStore, model => model.MaximumShoppingCartItems, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="MaximumShoppingCartItems" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <admin-input asp-for="MaximumShoppingCartItems" />
                                    <span asp-validation-for="MaximumShoppingCartItems"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.MaximumWishlistItems_OverrideForStore, model => model.MaximumWishlistItems, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="MaximumWishlistItems" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <admin-input asp-for="MaximumWishlistItems" />
                                    <span asp-validation-for="MaximumWishlistItems"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.MoveItemsFromWishlistToCart_OverrideForStore, model => model.MoveItemsFromWishlistToCart, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="MoveItemsFromWishlistToCart" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="MoveItemsFromWishlistToCart" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="MoveItemsFromWishlistToCart"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.ShowProductImagesOnShoppingCart_OverrideForStore, model => model.ShowProductImagesOnShoppingCart, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="ShowProductImagesOnShoppingCart" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="ShowProductImagesOnShoppingCart" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="ShowProductImagesOnShoppingCart"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.ShowProductImagesOnWishList_OverrideForStore, model => model.ShowProductImagesOnWishList, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="ShowProductImagesOnWishList" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="ShowProductImagesOnWishList" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="ShowProductImagesOnWishList"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.ShowDiscountBox_OverrideForStore, model => model.ShowDiscountBox, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="ShowDiscountBox" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="ShowDiscountBox" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="ShowDiscountBox"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.ShowGiftCardBox_OverrideForStore, model => model.ShowGiftCardBox, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="ShowGiftCardBox" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="ShowGiftCardBox" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="ShowGiftCardBox"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.CrossSellsNumber_OverrideForStore, model => model.CrossSellsNumber, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="CrossSellsNumber" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <admin-input asp-for="CrossSellsNumber" />
                                    <span asp-validation-for="CrossSellsNumber"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.EmailWishlistEnabled_OverrideForStore, model => model.EmailWishlistEnabled, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="EmailWishlistEnabled" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="EmailWishlistEnabled" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="EmailWishlistEnabled"></span>
                                </div>
                            </div>
                            <div class="form-group" id="pnlAllowAnonymousUsersToEmailWishlist">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.AllowAnonymousUsersToEmailWishlist_OverrideForStore, model => model.AllowAnonymousUsersToEmailWishlist, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="AllowAnonymousUsersToEmailWishlist" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="AllowAnonymousUsersToEmailWishlist" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="AllowAnonymousUsersToEmailWishlist"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.MiniShoppingCartEnabled_OverrideForStore, model => model.MiniShoppingCartEnabled, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="MiniShoppingCartEnabled" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="MiniShoppingCartEnabled" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="MiniShoppingCartEnabled"></span>
                                </div>
                            </div>
                            <div class="form-group" id="pnlMiniShoppingCartProductNumber">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.MiniShoppingCartProductNumber_OverrideForStore, model => model.MiniShoppingCartProductNumber, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="MiniShoppingCartProductNumber" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <admin-input asp-for="MiniShoppingCartProductNumber" />
                                    <span asp-validation-for="MiniShoppingCartProductNumber"></span>
                                </div>
                            </div>
                            <div class="form-group" id="pnlShowProductImagesInMiniShoppingCart">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.ShowProductImagesInMiniShoppingCart_OverrideForStore, model => model.ShowProductImagesInMiniShoppingCart, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="ShowProductImagesInMiniShoppingCart" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="ShowProductImagesInMiniShoppingCart" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="ShowProductImagesInMiniShoppingCart"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.AllowCartItemEditing_OverrideForStore, model => model.AllowCartItemEditing, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="AllowCartItemEditing" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="AllowCartItemEditing" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="AllowCartItemEditing"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.CartsSharedBetweenStores_OverrideForStore, model => model.CartsSharedBetweenStores, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="CartsSharedBetweenStores" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="CartsSharedBetweenStores" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="CartsSharedBetweenStores"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-8 col-md-4 col-sm-4 text-right">
                                    @Html.OverrideStoreCheckboxFor(model => model.AllowOnHoldCart_OverrideForStore, model => model.AllowOnHoldCart, Model.ActiveStoreScopeConfiguration)
                                    <admin-label asp-for="AllowOnHoldCart" class="control-label" />
                                </div>
                                <div class="col-4 col-md-8 col-sm-8">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="AllowOnHoldCart" />
                                        <div class="control__indicator"></div>
                                    </label>
                                    <span asp-validation-for="AllowOnHoldCart"></span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <vc:admin-widget widget-zone="shopping_cart_settings_bottom" additional-data="null" />
                </div>
            </div>
        </div>
    </div>
    <script>
        $(document).ready(function () {

            $("#@Html.FieldIdFor(model => model.MiniShoppingCartEnabled)").click(toggleMiniShoppingCartEnabled);
            $("#@Html.FieldIdFor(model => model.EmailWishlistEnabled)").click(toggleEmailWishlistEnabled);

            toggleMiniShoppingCartEnabled();
            toggleEmailWishlistEnabled();
        });

        function toggleMiniShoppingCartEnabled() {
            if ($('#@Html.FieldIdFor(model => model.MiniShoppingCartEnabled)').is(':checked')) {
                $('#pnlMiniShoppingCartProductNumber').show();
                $('#pnlShowProductImagesInMiniShoppingCart').show();
            }
            else {
                $('#pnlMiniShoppingCartProductNumber').hide();
                $('#pnlShowProductImagesInMiniShoppingCart').hide();
            }
        }

        function toggleEmailWishlistEnabled() {
            if ($('#@Html.FieldIdFor(model => model.EmailWishlistEnabled)').is(':checked')) {
                $('#pnlAllowAnonymousUsersToEmailWishlist').show();
            }
            else {
                $('#pnlAllowAnonymousUsersToEmailWishlist').hide();
            }
        }

    </script>
</form>