configuration - 如何在 Pimcore 的 CoreShop 中收听“确认”状态机?
问题描述
根据文档 https://docs.coreshop.org/2.1.0/Development/State_Machine/Available_Workflows.html https://docs.coreshop.org/2.1.0/Development/State_Machine/Create_Callbacks.html ,这个配置应该在刚刚创建订单时监听事件(用户在提交数据和发货后单击“购买”按钮)。
### CoreShop Workflow callbacks in config.yml of MyBundle
core_shop_workflow:
state_machine:
coreshop_order:
callbacks:
after:
preAuthorizeGuradoVoucher:
on: [ 'confirm' ]
do: [ '@MyBundle\EventListener\GuradoVoucherListener', 'preAuthorize' ]
# in this context, "object" is the order item
args: [ 'object' ]
priority: -10
newOrder:
on: [ 'new' ]
do: [ '@MyBundle\EventListener\GuradoVoucherListener', 'new' ]
# in this context, "object" is the order item
args: [ 'object' ]
priority: -10
requestPayment:
on: [ 'request_payment' ]
do: [ '@MyBundle\EventListener\GuradoVoucherListener', 'requestPayment' ]
# in this context, "object" is the order item
args: [ 'object' ]
priority: -10
coreshop_order_payment:
callbacks:
after:
sellGuradoVoucher:
on: [ 'paid' ]
do: [ '@MyBundle\EventListener\GuradoVoucherListener', 'sellVoucher' ]
# in this context, "object" is the order item
args: [ 'object' ]
priority: -10
redeemGuradoVoucher:
on: [ 'paid' ]
do: [ '@MyBundle\EventListener\GuradoVoucherListener', 'redeem' ]
# in this context, "object" is the order item
args: [ 'object' ]
priority: -10
refundGuradoVoucher:
on: [ 'refunded' ]
do: [ '@MyBundle\EventListener\GuradoVoucherListener', 'refund' ]
# in this context, "object" is the order item
args: [ 'object' ]
priority: -10
但事实上,当付款完成时,第一个事件在 /finish-order 页面上被调用。
如何配置在提交购物车和刚刚创建订单时捕获事件?
解决方案
推荐阅读
- javascript - 更改导航栏高度时下推页面的内容
- kubernetes - 增加 Kubernetes 内部负载均衡器/入口的 TCP 超时
- mysql - MySQL:如何在同一台服务器上保留一些表的同步副本
- sql - Elasticsearch 无法查询 WKT
- jquery - 在一个打开时关闭所有其他 DIV - 使用单独的关闭按钮
- modal-dialog - AngularDart检测组件内的Keyup事件
- c# - FTP 服务器图像在 MVC 应用程序的 html 页面中被阻止
- javascript - 我如何操作 json 值
- powershell - 无法访问上层管道中的变量
- powerbi - Power BI - DAX 查询以删除 SUM 计算中的重复行