0

I want to retrieve all the existing magento order attributes. For customer attributes i used Mage::getModel('customer/customer')->getAttributes(), for customer address attributes i used Mage::getModel('customer/address')->getAttributes(). Similarly how to get Order all attributes? I tried Mage::getModel('sales/order')->getAttributes(), but we don't have getAttributes() method for Mage_Sales_Model_Order .

Please help me on how to get order/quote getAttributes()?

Thanks.

1
  • Order model is not a EAV model. What kind of attributes you want to join?
    – Kirby
    Commented Sep 4, 2015 at 12:48

1 Answer 1

1

Since 'sales/order' and 'sales/quote' uses flat table and not EAV, then EAV attributes would be the same as the table columns name.

Try

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read'); 
$tableName = $resource->getTableName('sales/order');
$saleField=$readConnection->describeTable($tableName);

print_r($saleField);
5
  • this doesn't include attributes of shipping address, billing address, Payment, Invoice. How to get all attributes related to order?
    – M_N
    Commented Sep 7, 2015 at 9:03
  • Could you explain more on what your trying to accomplish? Commented Sep 9, 2015 at 13:38
  • @R.S how to achieve the same in magento2? Commented Jan 20, 2016 at 11:11
  • @prasadmaganti please create a new question Commented Jan 20, 2016 at 15:37
  • @R.S magento.stackexchange.com/questions/98148/… but no help Commented Jan 21, 2016 at 4:52

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.