custom/plugins/WbfkMultipleTransactions/src/Subscriber/OrderConvertedEventSubscriber.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Wbfk\MultipleTransactions\Subscriber;
  4. use Shopware\Core\Checkout\Cart\Order\OrderConvertedEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class OrderConvertedEventSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents(): array
  9.     {
  10.         return [
  11.             OrderConvertedEvent::class => 'addOrderTransactionsSummaryToCartAsExtension',
  12.         ];
  13.     }
  14.     public function addOrderTransactionsSummaryToCartAsExtension(OrderConvertedEvent $event): void
  15.     {
  16.         /** @noinspection PhpDeprecationInspection */
  17.         $event->getConvertedCart()->addExtension('transactionsSummary'$event->getOrder()->getExtension('transactionsSummary'));
  18.     }
  19. }