在spartacus中扩展PDP路由?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在spartacus中扩展PDP路由?相关的知识,希望对你有一定的参考价值。
我可以知道如何在spartacus中实现这个自定义路由吗?product/:productCode/:name/order-form
我试着在我的自定义路由中实现这个 order-form-routes.module.ts
但是它似乎不能识别这个配置,因为它抛出了一个Page Not Found错误。
ConfigModule.withConfig({
routing: {
routes: {
orderForm: {
paths: ['product/:code/:name/order-form'],
paramsMapping: { code: 'code', name: 'name' },
},
},
},
}),
答案
考虑到@Platonn的建议。这个配置让它工作了。
RouterModule.forChild([
{
path: 'product/:code/:name/order-form',
canActivate: [AuthGuard, CmsPageGuard],
component: PageLayoutComponent,
data: { pageLabel: '/order-form' },
},
]),
以上是关于在spartacus中扩展PDP路由?的主要内容,如果未能解决你的问题,请参考以下文章
关于 SAP Spartacus 重定向部分外部 url 到后台系统的问题
SAP Commerce Cloud 新一代 UI Spartacus 和 Customer Data cloud 的集成