Just another WordPress.com weblog

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->startSetup();
$installer->addAttribute(ORDER TYPE ID, 'YOUR ATTRIBUTE NAME', array('type' => 'int'));
$installer->endSetup();

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

AFTER THIS..
add a filed in sales_flat_order table …

now save the value ….
Keep Rocking …
Vishal Surani —

Advertisements

Comments on: "Magento :: Create Order Attribute." (2)

  1. Hey Vishal,

    How would you get that order attribute once set?

    Thanks

    • 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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: