I add a custom attribute from my module to sales order like this:

$attribute  = array(
    'type'          => 'int',
    'backend_type'  => 'int',
    'is_user_defined' => true,
    'label'         => 'Admin Id',
    'visible'       => false,
    'required'      => false,
    'user_defined'  => false,
    'searchable'    => true,
    'filterable'    => true,
    'comparable'    => true,
    'default'       => NULL
$installer->addAttribute('order', 'admin_id', $attribute);
$installer->addAttribute('quote', 'admin_id', $attribute);

and then I want to set the custom attribute data after I place an order using observer like this:




class Vendor_Module_Model_Observer
   public function orderPlace($event)
     $order = $event->getOrder();
       $adminId = Mage::getSingleton('admin/session')->getUser()->getUserId();
         $orderModel = Mage::getModel('sales/order')->load($order->getId());

     return $this;

   private function isAdmin()
          return true;

      if(Mage::getDesign()->getArea() == 'adminhtml')
          return true;

      return false;

but I always got an error like this:

Allowed memory size of 10485760 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0

or this:

Maximum execution time of 30 seconds exceeded in /var/www/vitamin/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 298

1 Answer 1


try to increase this values on php setting

ini_set('memory_limit', '512M');
ini_set('max_execution_time', 300); //300 seconds

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.