我們嘗試將現有的nopcommerce應用程序從3.40升級到3.90。如何在升級到nopcommerce後更新EngineContext.Current.Resolve <StoreInformationSettings>()。ResponsiveDesignSupported 3.9
遵循http://docs.nopcommerce.com/display/en/Upgrading+nopCommerce的所有步驟。
自定義主題和自定義插件的所有web.config文件MVC版本從System.Web.Mvc, Version=5.0.0.0,
更新爲System.Web.Mvc, Version=5.2.3.0
。
現在我們在自定義主題中出現以下錯誤。
編譯器錯誤消息:CS1061:「Nop.Core.Domain.StoreInformationSettings」不包含關於「ResponsiveDesignSupported」的定義和沒有擴展方法「ResponsiveDesignSupported」接受型Nop.Core.Domain的」第一個參數。 StoreInformationSettings「可以找到(您是否缺少使用指令或程序集引用?)
StoreInformationSettings中似乎沒有ResponsiveDesignSupported屬性。
nopcommerce 3.90有沒有辦法讓ResponsiveDesignSupported
設置?
下面一些代碼
@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 to display? in this case let's diplay some 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 to display? in this case let's diplay some 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>
}
你有什麼其他屬性可以訪問?你能展示一些代碼嗎? – DavidG
@DavidG我添加了代碼 – Dairo
嗯我覺得這個選項剛剛被刪除,因爲現在沒有辦法停用響應。有意義的事情,因爲一切都應該是敏感的。 – DavidG