How do I update the unit price of an order item on Add to Cart in Commerce 2.x? I added an event subscriber for add to cart event. There I defined a function to react on add to cart event. Everything works fine as my eventsubscriber is being called. I want to update the unit price of product which is being added to cart. Below is the code I used but it is not working. Price of the product is not updating to the price I am setting.

public function updateProductPrice(CartEntityAddEvent $event) {
    $unit_price = new Price('15.00', 'EUR');
    $event-&gt;getOrderItem()-&gt;setUnitPrice($unit_price,TRUE);    
  }


I have tried with both overide TRUE and FALSE but nothing works.
I managed to update the price by updating the order item of order rather than the order item in event.

$items = $event-&gt;getOrder()-&gt;getItems();
foreach ($items as $key =&gt; $item) {
    $currencyCode = $item-&gt;getUnitPrice()-&gt;getCurrencyCode();
    $unit_price = new Price('20.00', $currencyCode);
    $item-&gt;setUnitPrice($unit_price,TRUE);
    $item-&gt;save();
}