Maybe this is the best for you:
$attribute = Mage::getModel('catalog/product')->load($productId)->getResource()->getAttribute($attributeCode); if ($attribute && $attribute->getId()) { ... }
You can also try
$attributes = $product->getAttributes();
But you can check everything in the attribute collection:
$entityTypeId = Mage::getModel('eav/entity') ->setType('catalog_product') ->getTypeId(); $attributeId = 5; $attributeSetName = 'Default'; $attributeSetId = Mage::getModel('eav/entity_attribute') ->getCollection() ->addFieldToFilter('entity_type_id', $entityTypeId) ->addFieldToFilter('attribute_set_name', $attributeSetName) ->addFieldToFilter('attribute_id', $attributeId) ->getFirstItem();
Maybe the source code needs some corrections, but I think you will understand this idea.
See a few more examples, also - http://www.blog.magepsycho.com/playing-with-attribute-set-in-magento/
freento
source share