Magento :: Create Order Attribute.

Posted: October 8, 2010 in Magento, Version 1.4.*

If you want in create Order Attribute in Magento 1.4.* ..
Here is the code ..

Run this code once

$installer = Mage::getModel('eav/entity_setup');
$installer->addAttribute(ORDER TYPE ID, 'YOUR ATTRIBUTE NAME', array('type' => 'int'));

if you want to find Order_type_id for you site
look in eav_entity_type table .. you can find order_type_id..

add a filed in sales_flat_order table …

now save the value ….
Keep Rocking …
Bijal Bhavsar :)—

  1. molecule says:

    Hey Vishal,

    How would you get that order attribute once set?


    • Mage Cracker says:

      lets take an example of order object
      simple , $order->getAttributeCode();

      if you want to set attribute value then $order->setAttributeCode()->save();

      Please , let me know if you have problem in this …

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s