I want to add one new custom field to one page checkout in Magento. I have created a module with installer:
$installer = $this;
$installer->startSetup();
$set
Add an observer :
singleton
mymodule/observer
Savefield
And in the mymodule/savefield/model/obsever.php file add this:
class Mymodule_Savefield_Model_Observer
{
public function Savefield($observer){
//get event data
$event = $observer->getEvent();
//get order
$order = $event->getOrder();
//set the variable here
$order->setMyField($fieldVal);
}
}