0

I want all the attributes of sales/order with their name and front-end label. I've tried following. But its not working.

Mage::getResourceModel('sales/order_attribute_collection');

By following code i was able to get all the fields. But its not giving me Front-end labels. I want front-end labels as well...

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

Thanks.

EDIT : Browsing following folder structure

1. app\code\core\Mage\Sales\Model\Resource\Order\Attribute
2. app\code\core\Mage\Sales\Model\Entity\Order\Attribute
3. app\code\core\Mage\Sales\Model\Mysql4\Order\Attribute

I found Attribute folder does not have collection.php file like 'catalog/product' or 'customer' modules have.

2

What you want to achieve is a little bit complex.

In the past Magentos quote, invoice, credit memo and shipping were EAV tables, but this changed I think from 1.5 to 1.6. So the orders doesn't have attributes anymore, as you can see, when you check the table eav_attribute. You still find an entry in eav_entity_type but no reference in the attribute table.

Therefore there is no way to get this automatically and the "frontend labels" are just translated strings.

  • Oh, I didn't know that. anyways thanks for saving my time finding a solution. – JItendra Rana Feb 26 '15 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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