<?php
declare(strict_types=1);
namespace Wbfk\MultipleTransactions\Subscriber;
use Shopware\Core\Checkout\Cart\Order\OrderConvertedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class OrderConvertedEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
OrderConvertedEvent::class => 'addOrderTransactionsSummaryToCartAsExtension',
];
}
public function addOrderTransactionsSummaryToCartAsExtension(OrderConvertedEvent $event): void
{
/** @noinspection PhpDeprecationInspection */
$event->getConvertedCart()->addExtension('transactionsSummary', $event->getOrder()->getExtension('transactionsSummary'));
}
}