Is there a way to change the item price when adding an item to the cart in SCA?
I’ve tried a few things, but nothing seems to work. For example:
cart.on("beforeAddLine", function() {
// ...
});
and:
Application.on("before:LiveOrder.addLines", function(model, lines) {
// ...
});
I tried modifying the price in these events, but the cart still uses the item’s standard price.
My requirement is that each customer can have a different price for each item. NetSuite’s standard Price Level doesn’t really work for this case, so I’m currently storing the customer/item prices in a custom record.
For example, the item price is $100 normally, but for Customer A the price should be $80.
I need to use the $80 price when the item is added to the cart, and also make sure the same price is used when the order is submitted.
Has anyone done something like this in SuiteCommerce? Is there a way to set the item price during addItem / addLines, or is there another recommended way to handle this?
Any suggestions would be appreciated. Thanks!