I need to set some properties on an orderline whenever a product is being added to an order.
My initial thought, derived from my uCommerce experince, would be to add a task, in this case a handler, that would set those properties.
So, I thought that I might just make a class that inherits
NotificationEventHandlerBase<OrderProductAddingNotification>
and look at the values that are passed into the handler.
Lo and behold, there is a property called
Properties
. It's a dictionary that can be manipulated, eg. not an
IReadOnlyDictionary
. It is also not marked as nullable so I figured I could use that. Digging through some decompiled code, it actually seems that the values in this property will be added to the orderline. Excellent.
However.
The
Properties
property on the
OrderProductAddingNotification
object is
null
and only has a getter so I wont be able to instantiate the property my self.
I also tried the
OrderProductAddedNotification
, same result and the
OrderLineAddingNotification
only has a readonly dictionary.
So, how do I set properties on an orderline, whenever a product is added?
I'm using Umbraco Commerce 15.0.1