I am working on a custom API for a client’s Magento site and I’m running into some trouble accessing all the required data that I need to include in the API response. One of the methods in this API is to return a product’s attributes. An example product would be a part from a specific television. The product has an attribute defined called tv_make, and this attribute is defined as a “dropdown” with many options (Sony, Toshiba, etc).
When I try to pull together a collection from the catalog_product model, everything seems to work fine except for the value of attributes like the above tv_make. I get something like the value “80”, when I’m looking for “Sony”. Below is the code I a currently have and I’m not sure when the proper join syntax is to pull the attribute’s option value instead of ID.
$collection = Mage::getModel('catalog/product')->getCollection()
I have also tried things like this, with no luck:
$collection->joinAttribute('brand', 'catalog_product/tv_make', 'entity_id', null, 'left');
Any help in the right direction would be appreciated!