• Welcome to KonaKart Community Forum. Please login or sign up.
 

Update csutom fields in orders_products table

Started by HappyHippo, September 10, 2015, 04:33:45 am

Previous topic - Next topic

HappyHippo

Hi!
I have added custom values in order_products's custom1,custom2 fields at the time of order placement. Now i want to update those fields on some events. How would i do that?

OrderUpdateIf updateOrder = new OrderUpdate();
updateOrder.setUpdatedById(order.getCustomerId());
order.setCustom1("XYZ");
kkEng.getOrderMgr().saveOrder(false, null);

doesn't seems to work to update even order tables's custom fields.

Thanks a lot.

julie

What you could do is to call the updateOrder() AdminApi call which forces a method to be called in the AdminOrderIntegrationMgr.

In the AdminOrderIntegrationMgr you need to add your customised code to the changeOrderStatus() method. As you can see from the many examples in the AdminOrderIntegrationMgr  here you can use the Torque Database layer to edit the order as you see fit.

HappyHippo

Thank you for the quick reply Julie!
I am using KK community addition so i don't have source code of AdminOrderIntegrationMgr. Can i call  OrderIntegrationMgr's changeOrderStatus() instead and change database from there?

Thanks again.

julie

All versions have access to the AdminOrderIntegrationMgr.

HappyHippo

Thank you Julie! That's a great info and i will check it out!
I was busy so could't reply earlier...

Thanks again!