in the final stage when nopcommerce has succesfully processed the order, I want to do some additional things with the items. (transfer the items to an external service)
I would like to know what is the best place (controller-action) to do this ?
in the final stage when nopcommerce has succesfully processed the order, I want to do some additional things with the items. (transfer the items to an external service)
I would like to know what is the best place (controller-action) to do this ?
thanks
Richard
Besy way is to always try to not modify the core source code. So you have to develop a plugin for this - luckily, nopcommerce has an event system implemented, and all you have to do is to listen to the OrderPlaced event (see link below)
Alternatively, you can customize the code from your payment plugin, and execute your code after the payment is done - whatever suits your case. But always avoid editing core source code - you'll have problems when you want to upgrade nopcommerce
\ public void HandleEvent(OrderPlacedEvent eventMessage) { var order = eventMessage.Order; var products = order.OrderItems; foreach (var product in products) { //Do your stuf } } } }