Skip to content

Instantly share code, notes, and snippets.

@rgranadino
Created September 14, 2011 16:49
Show Gist options
  • Save rgranadino/1217074 to your computer and use it in GitHub Desktop.
Save rgranadino/1217074 to your computer and use it in GitHub Desktop.
Load Attribute With Store Frontend Label
<?php
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Collection */
//note for 1.6 collection class is Mage_Catalog_Model_Resource_Product_Attribute_Collection
$collection = Mage::getResourceModel('catalog/product_attribute_collection')
->setItemObjectClass('catalog/resource_eav_attribute')
->setCodeFilter(ATTRIBUTE_CODE)
->addStoreLabel(Mage::app()->getStore()->getId())
->load();
/* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
$attribute = $collection->getFirstItem();
$attribute->getStoreLabel();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment