jayelkaake / enhancedgrid

The original enhanced admin product grid for Magento.
https://www.magentocommerce.com/magento-connect/enhanced-admin-product-grid.html
94 stars 61 forks source link

Use Admin Label as Column Heading #50

Open YaegerDesign opened 7 years ago

YaegerDesign commented 7 years ago

If you choose a custom attribute as a filter/column, the admin shows the header as the attribute ID/alias instead of the label like the default columns. However, in the system configuration for the extension, the labels are used correctly when choosing what columns to display.

mobweb commented 7 years ago

Would also like this. What you can do though is add a translation for the attribute ID to a translation file, then it will use the translation as the column header.

jayelkaake commented 7 years ago

Sorry, haven't been able to add this in yet... PRs are very welcome!

kohjacky commented 7 years ago

What i did as follow, works for me: Replace the following on line 527 of app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php

$innerSettings = array( 'header' => Mage::helper('catalog')->__($col), 'width' => '100px', 'type' => 'text', );

with

$attribute = Mage::getModel('catalog/resource_eav_attribute')->loadByCode(Mage_Catalog_Model_Product::ENTITY, $col); $label = $attribute->getFrontendLabel(); $innerSettings = array( 'header' => Mage::helper('catalog')->__($label), 'width' => '100px', 'type' => 'text', );

jayelkaake commented 7 years ago

Can you submit a PR for that @kohjacky so we can get it merged? Thanks so much!

kkrieger85 commented 5 years ago

Can be closed. See https://github.com/jayelkaake/enhancedgrid/commit/3e47dd29a892555476a4e8fb963d38a025e3dd1b