Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created January 16, 2014 16:37
Show Gist options
  • Select an option

  • Save ryaan-anthony/8458204 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/8458204 to your computer and use it in GitHub Desktop.
<?php
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn($installer->getTable('sales/quote'), 'surcharge', 'decimal(12,4)');
$installer->getConnection()
->addColumn($installer->getTable('sales/order'), 'surcharge', 'decimal(12,4)');
$installer->endSetup();
$setup = new Mage_Sales_Model_Mysql4_Setup('core_setup');
$setup->startSetup();
$setup->addAttribute('quote', 'surcharge', array('type' => 'decimal', 'visible' => false, 'required' => false));
$setup->addAttribute('order', 'surcharge', array('type' => 'decimal', 'visible' => false, 'required' => false));
$setup->addAttribute('invoice', 'surcharge', array('type' => 'decimal', 'visible' => false, 'required' => false));
$setup->addAttribute('creditmemo', 'surcharge', array('type' => 'decimal', 'visible' => false, 'required' => false));
$setup->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment