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->getOrderItem()->setUnitPrice($unit_price,TRUE);
}
I have tried with both overide TRUE and FALSE but nothing works.