Updating in Order in the Database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hello,
I am new to nopCommerce. I have an order object that is filled with data. Now I changed a field of it and want to save it in the Order table in the Database. Can someone tell me in a cookbook way how this is done in NopCommerce? I could not find any update function in the order object.
7 years ago
Hi,

You can use like

_OrdereService.UpdateOrder(order);
7 years ago
I am using CheckMoneyOrder Plugin and I am in the PostProcessPayment of CheckMoneyOrderPaymentProcessor. In this class there is no OrderService which I could use. How can get the OrderService object in this class so I can use it in the PostProcessPayment method? Or how can I update an order in the DB when I am in the PostProcessPayment method?
7 years ago
MbProg wrote:
I am using CheckMoneyOrder Plugin and I am in the PostProcessPayment of CheckMoneyOrderPaymentProcessor. In this class there is no OrderService which I could use. How can get the OrderService object in this class so I can use it in the PostProcessPayment method? Or how can I update an order in the DB when I am in the PostProcessPayment method?

You can just add the OrderService to the CheckMoneyOrderPaymentProcessor constructor

public CheckMoneyOrderPaymentProcessor(CheckMoneyOrderPaymentSettings checkMoneyOrderPaymentSettings,
    ISettingService settingService, IOrderTotalCalculationService orderTotalCalculationService, IOrderService orderService)
{
    this._checkMoneyOrderPaymentSettings = checkMoneyOrderPaymentSettings;
    this._settingService = settingService;
    this._orderTotalCalculationService = orderTotalCalculationService;
    this._orderService = orderService;    
}
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.