SAP 电商云 Spartacus UI Configurable Product 的页面设置
创始人
2024-03-02 14:24:15
0

关键字

CPQ,Product Configuration,Product Configure,Product Variant

变体是在某些方面彼此不同但基于相同基本模型的产品。 变体的一个示例是 T 恤的颜色和尺寸。 在 Spartacus 中启用变体功能,并在 SAP Commerce Cloud 中配置产品后,客户可以在店面中选择具有他们选择的变体(或多个变体)的产品。

启用 variant 的代码:

ConfigModule.withConfig({cmsComponents: {ProductVariantSelectorComponent: {component: ProductVariantSelectorComponent,guards: [ProductVariantGuard],},},}),

具有变体的产品需要在 /page 响应中包含 ProductVariantSelectorComponent CMS 组件,并且需要在页面上呈现它们。

搜索 home theater

url:

custom Angular Component:cx-configure-product‘

url:http://localhost:4000/electronics-spa/en/USD/configure/vc/product/entityKey/CONF_HOME_THEATER_ML

http://localhost:4000/electronics-spa/en/USD/configure/vc/product/entityKey/CONF_HOME_THEATER_ML
打开之后是这样:

在这个 template 里面:ProductDetailsPageTemplate

运行时的 Summary content slot:

summary 里的 Component:

仅当 configurable 为 true 才显示:

打印出来:

owner type 硬编码成 product:

这是标准的接口:

http://localhost:4000/electronics-spa/en/USD/configure/vc/product/entityKey/CONF_HOME_THEATER_ML

运行时打印出来的 pipe 的输入和输出数据:

上面的是已经进到 configuration 明细页面后打印出来的。不对,重新找。

这个才是正确的:

把程序修改一下:

判断是否是 route 配置:

只要 command 对象有 cxRoute,就被认为是 route command:

根据 route 名称从 route configure 里拿到配置:

  getRouteConfig(routeName: string): RouteConfig {const routeConfig = this.config?.routing?.routes;const result = routeConfig && routeConfig[routeName];if (!routeConfig || result === undefined) {this.warn(`No path was configured for the named route '${routeName}'!`);}return result;}

path: configure/vc/:ownerType/entityKey/:entityKey

把 path 里的变量 place holder 用实际值进行替换:

最后结果:

添加到购物车之后:

URL 如下:

http://localhost:4000/electronics-spa/en/USD/configure/vc/cartEntry/entityKey/0?forceReload=true&resolveIssues=false

相关内容

热门资讯

AWSECS:访问外部网络时出... 如果您在AWS ECS中部署了应用程序,并且该应用程序需要访问外部网络,但是无法正常访问,可能是因为...
AWSElasticBeans... 在Dockerfile中手动配置nginx反向代理。例如,在Dockerfile中添加以下代码:FR...
银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...
北信源内网安全管理卸载 北信源内网安全管理是一款网络安全管理软件,主要用于保护内网安全。在日常使用过程中,卸载该软件是一种常...
AWR报告解读 WORKLOAD REPOSITORY PDB report (PDB snapshots) AW...
AWS管理控制台菜单和权限 要在AWS管理控制台中创建菜单和权限,您可以使用AWS Identity and Access Ma...
​ToDesk 远程工具安装及... 目录 前言 ToDesk 优势 ToDesk 下载安装 ToDesk 功能展示 文件传输 设备链接 ...
群晖外网访问终极解决方法:IP... 写在前面的话 受够了群晖的quickconnet的小水管了,急需一个新的解决方法&#x...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
Azure构建流程(Power... 这可能是由于配置错误导致的问题。请检查构建流程任务中的“发布构建制品”步骤,确保正确配置了“Arti...