Shopware-获取文档生成事件 [英] Shopware - get Document Generation Events

查看:77
本文介绍了Shopware-获取文档生成事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Shopware6中的事件,我需要您的帮助.我想知道当通过后端手动创建 贷方通知单时如何获得活动.

I need your help about events in Shopware6. I'd like to know how I can get the event when a credit note is created manually through the backend.

例如,我采取了以下事件: OrderEvents :: ORDER_TRANSACTION_WRITTEN_EVENT ,该事件可在"/vendor/shopware/core/Checkout/Order/OrderEvents.php"中找到.

As example, I took this event : OrderEvents::ORDER_TRANSACTION_WRITTEN_EVENT which is findable in "/vendor/shopware/core/Checkout/Order/OrderEvents.php".

我试图在我的documentSubscriber中复制相同的语法,如下所示: DocumentEvents :: DOCUMENT_WRITTEN_EVENT ,但此事件在"/vendor/shopware/core/Checkout/Document/...中找不到

I tried to copy the same syntax in my documentSubscriber like this : DocumentEvents::DOCUMENT_WRITTEN_EVENT but this event is not findable in "/vendor/shopware/core/Checkout/Document/...".

很自然地,我遇到此错误:" 试图加载类"DocumentEvents"来自命名空间"Emakers \ TransmissionPlugin \ Subscriber".您是否忘记了使用"功能?另一个名称空间的声明? "

So naturally, I am having this error : "Attempted to load class "DocumentEvents" from namespace "Emakers\TransmissionPlugin\Subscriber". Did you forget a "use" statement for another namespace?"

我无法获得正确的使用"声明以进行此事件.我目前不知道我可以使用哪个事件,有人知道吗?

I cannot have the correct "use" statement to make this event. I have no clue on which event I can use at this moment, does someone have an idea?

推荐答案

就像@Valerii Pravoslavnyi所说的那样,经过一番调查,每个实体都有一个可以在核心中找到的书面事件.例如,在我的情况下,我使用了:就像魅力一样!

as @Valerii Pravoslavnyi said and after some investigation, every entity has a written event you can find in the core. For example in my case, I used : "document.written" and it worked like a charm !

这篇关于Shopware-获取文档生成事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆