【发布时间】:2021-08-18 11:04:36
【问题描述】:
我创建了一个插件,但它需要一个定制的产品模板,我无法让它工作。有人可以帮我理解我做错了什么吗?
到目前为止,我有:
- 转到https://example.com/Admin/Template/List并添加了新的产品模板 1a。将视图路径设置为“myCustomPlugin.Views.Product.ProductTemplateCustom.Simple”
- 转到https://example.com/Admin/Product/Edit/46 并使用新产品模板设置该产品
- 在我的插件代码中,我在以下位置创建了模板:myCustomPlugin\Views\Product\ProductTemplateCustom.Simple.cshtml
- 已加载产品页面
当我加载我得到的产品页面时:
InvalidOperationException:InvalidOperationException:未找到视图“ProductTemplateCustom.Simple”。搜索了以下位置: /Themes/DefaultClean/Views/Product/ProductTemplateCustom.Simple.cshtml /Themes/DefaultClean/Views/Shared/ProductTemplateCustom.Simple.cshtml /Views/Product/ProductTemplateCustom.Simple.cshtml /Views/Shared/ProductTemplateCustom .Simple.cshtml /Pages/Shared/ProductTemplateCustom.Simple.cshtml
-
我检查了
Nop.Web\Plugins\myCustomPlugin\Views\Product和ProductTemplateCustom.Simple.cshtml已被复制。 -
我查看了
RouteProvider.cs,期待需要将一些路由配置添加到我的插件中,但我什么也看不到 -
Their documentation 说我必须向
Views\Product添加一个新产品模板,所以我已经这样做了,但它存在于我的插件路径中,我无法弄清楚如何让 NopCommerce 在该位置查看
【问题讨论】:
标签: nopcommerce