Score:0

Commerce Event Subcriber

cn flag

I have created a custom event subscriber for Commerce, but when the event is triggered, somehow the Order number is increased by +1 and I get suddenly confirmation emails for 2 orders.

I'm not doing anything special when the event happens, just sending a test email.

  static function getSubscribedEvents() {
    $events['commerce_order.place.post_transition'] = ['orderCompleteHandler', -200];
    return $events;
  }

And this is the event action:

$this->mailManager->mail('commerce', 'receipt', $to, $langcode, $params, $reply, $send);
cn flag
Seems like this is the root cause: https://www.drupal.org/project/commerce/issues/3085805
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.