当前位置:网站首页>SAP Spartacus checkout 流程的扩展(extend)实现介绍
SAP Spartacus checkout 流程的扩展(extend)实现介绍
2022-07-07 00:37:00 【汪子熙】
Spartacus中的 checkout 特性是CMS驱动的,这意味着 checkout 流中的每个页面都基于CMS页面、slots 和 Component。因此,开发可以更改每个页面的内容、添加新组件、将 checkout 转换为单步骤签出,或者在店面应用程序中只需要少量配置就可以创建非常复杂的多步骤 checkout 工作流。
在 checkout 过程中,通常有从一个步骤到另一个步骤的链接,这就是将每个 checkout 页面注册为店面配置中的 semantic page
的原因。
checkout 的默认路由配置如下:
provideConfig({
routing: {
routes: {
checkout: {
paths: ['checkout'],
},
checkoutShippingAddress: {
paths: ['checkout/shipping-address']
},
checkoutDeliveryMode: {
paths: ['checkout/delivery-mode']
},
checkoutPaymentDetails: {
paths: ['checkout/payment-details']
},
checkoutReviewOrder: {
paths: ['checkout/review-order']
}
},
},
}),
上述代码的位置:default-routing-config.ts
虽然默认的 checkout 有四个步骤,但是默认的配置定义了五个语义页面。这个附加页面有一个通用的 checkout 路由,它链接到每个应该重定向到 checkout 的组件。从这个常规 checkout 页面,Spartacus重定向到具体而正确
的 checkout step 步骤。
如果您想链接到 checkout,那么无论您的 checkout 流程具体是如何设计的,都要指向这个通用结帐页面。比如,对于多步骤 checkout,可以使用 CheckoutGuard 来重定向到正确的checkout 步骤。
通过单步checkout,您可以在这个签出路由上设置所有组件,并从组件配置中删除CheckoutGuard。
除了路由配置之外,还可以通过定义每个步骤的职责、到页面的路由和步骤的顺序来配置 checkout. 默认配置如下:
id 属性应该有一个惟一的值。当需要标识配置中的特定步骤时,可以使用id。
在
CheckoutProgress
组件中使用name属性来指示哪些签出步骤已经完成。该名称也用作翻译键。routeName属性为每个步骤指定语义页。
type 属性由
checkout guards
使用。
边栏推荐
- SQL query: subtract the previous row from the next row and make corresponding calculations
- C#可空类型
- Flink SQL realizes reading and writing redis and dynamically generates hset key
- 谈fpga和asic的区别
- 话说SQLyog欺骗了我!
- 随机生成session_id
- Go language context explanation
- SAP ABAP BDC (batch data communication) -018
- Hcip eighth operation
- 一个简单的代数问题的求解
猜你喜欢
Web Authentication API兼容版本信息
Reptile exercises (III)
Randomly generate session_ id
Unity keeps the camera behind and above the player
What is dependency injection (DI)
软件测试面试技巧
AI face editor makes Lena smile
R language [logic control] [mathematical operation]
Determine whether the file is a DICOM file
老板总问我进展,是不信任我吗?(你觉得呢)
随机推荐
MySQL-CentOS7通过YUM安装MySQL
Web architecture design process
如何提高网站权重
async / await
Flask 1.1.4 werkzeug1.0.1 analyse du code source: processus de démarrage
[solved] record an error in easyexcel [when reading the XLS file, no error will be reported when reading the whole table, and an error will be reported when reading the specified sheet name]
How to improve website weight
拼多多新店如何获取免费流量,需要从哪些环节去优化,才能有效提升店内免费流量
EMMC print cqhci: timeout for tag 10 prompt analysis and solution
《ClickHouse原理解析与应用实践》读书笔记(6)
[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
Go 語言的 Context 詳解
Add salt and pepper noise or Gaussian noise to the picture
Flask1.1.4 werkzeug1.0.1 source code analysis: start the process
Bat instruction processing details
nVisual网络可视化
STM32 key state machine 2 - state simplification and long press function addition
What is dependency injection (DI)
Sidecar mode
消息队列:消息积压如何处理?