KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: HappyHippo on September 10, 2015, 04:33:45 am

Title: Update csutom fields in orders_products table
Post by: HappyHippo on September 10, 2015, 04:33:45 am
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.
Title: Re: Update csutom fields in orders_products table
Post by: julie on September 10, 2015, 11:04:00 am
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.
Title: Re: Update csutom fields in orders_products table
Post by: HappyHippo on September 11, 2015, 12:02:17 pm
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.
Title: Re: Update csutom fields in orders_products table
Post by: julie on September 11, 2015, 12:17:03 pm
All versions have access to the AdminOrderIntegrationMgr.
Title: Re: Update csutom fields in orders_products table
Post by: HappyHippo on September 22, 2015, 04:04:30 am
Thank you Julie! That's a great info and i will check it out!
I was busy so could't reply earlier...

Thanks again!