Magento 1.9 Get Custom Field from Order Table Programmatically

custom-fieldmagento-1.9

In my Magento 1.9, I have an extension fooman surcharge installed. and the extension added some extra fields into sales_flat_order

How can I programmatically retrieve the data from these fields?

for example in the screenshot, I want to get the data from the field fooman_surcharge_amount.

enter image description here

Best Answer

You can get values from order object as follows.

$surchargeAmount = $order->getData('fooman_surcharge_amount');

Where $order is previously loaded order object.

Related Topic