When adding an item to the cart, there are cases where you need to set a custom price. This is currently not possible without a work-around.
One solution is to decorate IPriceCalculator
, but this calculation would not have any context regarding the actual add request, only what is passed along in PriceCalculatorItemArgs
. Another solution is to decorate ISalesOrderRowFactory
, but this is only triggered when adding a new item, never on update. Also, the create method in ISalesOrderRowFactory
is not async, which is a limitation.
The best solution would be to add a UnitPriceExcludingVat
property in the AddOrUpdateCartItemArgs
class, which would take precedence over the default price calculations.