c# - How to update EngineContext.Current.Resolve<StoreInformationSettings>().ResponsiveDesignSupported after upgrade to nopcommerce 3.9 -
we try upgrade existing nopcommerce application 3.40 3.90.
all steps http://docs.nopcommerce.com/display/en/upgrading+nopcommerce followed.
in web.config files custom themes , custom plugins mvc version updated system.web.mvc, version=5.0.0.0,
system.web.mvc, version=5.2.3.0
.
now folowing error in our custom theme.
compiler error message: cs1061: 'nop.core.domain.storeinformationsettings' not contain definition 'responsivedesignsupported' , no extension method 'responsivedesignsupported' accepting first argument of type 'nop.core.domain.storeinformationsettings' found (are missing using directive or assembly reference?)
there seems no responsivedesignsupported property in storeinformationsettings.
is there way in nopcommerce 3.90 responsivedesignsupported
setting?
below code
@model topmenumodel @using nop.core.domain @using nop.core.infrastructure @using nop.web.models.catalog; @{ var isrtl = this.shouldusertltheme(); var supportresponsive = enginecontext.current.resolve<storeinformationsettings>().responsivedesignsupported; } @helper rendercategoryline(categorysimplemodel category, int level, bool responsivemobilemenu) { <li> <a href="@url.routeurl("category", new { sename = category.sename })">@category.name @if (category.numberofproducts.hasvalue) { <text> </text>@t("categories.totalproducts", category.numberofproducts.value) } </a> @{ var levelclass = ""; if (level == 0) { levelclass = "firstlevel"; <div class="top-menu-triangle"></div> } if (category.subcategories.count > 0) { if (responsivemobilemenu) { <span class="expand"> </span> } <div class="sublist @levelclass"> <ul> @foreach (var subcategory in category.subcategories) { @rendercategoryline(subcategory, level + 1, responsivemobilemenu) } </ul> </div> } } </li> } <ul class="top-menu"> @html.widget("header_menu_before") @if (model.categories.count > 0) { <li><a href="@url.routeurl("homepage")"><i class="fa fa-home fa-lg"> </i></a></li> foreach (var category in model.categories) { @rendercategoryline(category, 0, false) } } else { //no categories display? in case let's diplay default menu items (should we?) <li><a href="@url.routeurl("homepage")">@t("homepage")</a></li> if (model.recentlyaddedproductsenabled) { <li><a href="@url.routeurl("recentlyaddedproducts")">@t("products.newproducts")</a> </li> } <li><a href="@url.routeurl("productsearch")">@t("search")</a> </li> <li><a href="@url.routeurl("customerinfo")">@t("account.myaccount")</a></li> if (model.blogenabled) { <li><a href="@url.routeurl("blog")">@t("blog")</a></li> } if (model.forumenabled) { <li><a href="@url.routeurl("boards")">@t("forum.forums") </a></li> } <li><a href="@url.routeurl("contactus")">@t("contactus")</a></li> } @html.widget("header_menu_after") </ul> <script type="text/javascript"> $('li', '.top-menu').on('mouseenter', function () { $('a', $(this)).first().addclass('hover'); if (!$(this).parent().hasclass('top-menu')) { var width = $(this).innerwidth(); $('.sublist', $(this)).first().css('@(isrtl ? "right" : "left")', width + 15); } $('.sublist', $(this)).first().addclass('active'); $('.top-menu-triangle', $(this)).addclass('active'); }); $('li', '.top-menu').on('mouseleave', function () { $('a', $(this)).first().removeclass('hover'); $('.sublist', $(this)).first().removeclass('active'); $('.top-menu-triangle', $(this)).removeclass('active'); }); </script> @if (supportresponsive) { <div id="mob-menu-button"> <a href=""> <span class="icon"><span class="line"></span><span class="line"></span><span class="line"></span></span> @{ var responsivemenutitle = model.categories.count > 0 ? t("categories") : t("menu"); } <span>@responsivemenutitle</span> </a> </div> <ul class="mob-top-menu"> @html.widget("mob_header_menu_before") @if (model.categories.count > 0) { foreach (var category in model.categories) { @rendercategoryline(category, 0, true) } } else { //no categories display? in case let's diplay default menu items (should we?) <li><a href="@url.routeurl("homepage")">@t("homepage")</a></li> if (model.recentlyaddedproductsenabled) { <li> <a href="@url.routeurl("recentlyaddedproducts")">@t("products.newproducts")</a> </li> } <li><a href="@url.routeurl("productsearch")">@t("search")</a> </li> <li><a href="@url.routeurl("customerinfo")">@t("account.myaccount")</a></li> if (model.blogenabled) { <li><a href="@url.routeurl("blog")">@t("blog")</a></li> } if (model.forumenabled) { <li><a href="@url.routeurl("boards")">@t("forum.forums") </a></li> } <li><a href="@url.routeurl("contactus")">@t("contactus")</a></li> } @html.widget("mob_header_menu_after") </ul> <script type="text/javascript"> $('a', $('#mob-menu-button')).toggle(function() { $('.mob-top-menu').addclass('show'); }, function() { $('.mob-top-menu').removeclass('show'); } ); $(function($) { $('.mob-top-menu .expand').click(function() { var parent = $(this).parent(); if (parent.hasclass('active')) { $(".sublist:first", parent).hide(300); parent.removeclass('active'); } else { $(".sublist:first", parent).show(300); parent.addclass('active'); } }); }); </script> }
since version 3.70 responsivedesignsupported setting no longer available, , nop supports responsive themes out of box, if want turn off or turn on responsive designs in theme, should done inside theme jquery, css.
Comments
Post a Comment