Getting product and order data through the appropriate api calls work well, but a problem arises when a product attribute uses dropdown or similar lists, where the value I get through the api is the ID of the selected value, not the label/value.

At least by default, Magento offers no resource called 'Attribute' that could deliver those values.

Is there a way to retrieve either the corresponding value to a given ID or the matrix (ID : value) of such an attribute?

I would need this kind of data from multiple shops, ranging from ce- to ce-


Have you tried this?

$option_id = Mage::getResourceModel('catalog/product')
    ->getAttributeRawValue($prod_id, $attribute_code, $store_id); 
  • the question was not about getting the value in magento, as I would prefer to keep the changes in the shops to a minimum, but rather a way to get the values/labels from the external allpication via rest api. Simply getting an internal magento id without much context as value for an attribute makes it rather useless for outside applications. – Andre.Schumacher Jul 27 '15 at 12:52

A simple code to get value from attribute code

$attribute_code = "color";    
$attributeValue = $_product->getAttributeText($attribute_code);

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.