<?php
namespace App\EventListener;
use App\Model\Product\LeafletProduct;
use Pimcore\Event\Model\Ecommerce\OrderManagerItemEvent;
class ItemOrderEventListener {
/**
* @param OrderManagerItemEvent $event
*
* @throws \Exception
*/
public function onItemCreation(OrderManagerItemEvent $event)
{
$item = $event->getCartItem();
$orderItem = $event->getOrderItem();
$product = $item->getProduct();
if (method_exists($product,'getPart')) {
$orderItem->setPart($product->getPart());
}
if (method_exists($product,'getSku')) {
$orderItem->setPart($product->getSku());
}
}
}