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-1.8.0.1 to ce-1.9.0.1
2 Answers 2
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– Andre.Schumacher2015年07月27日 12:52:05 +00:00Commented Jul 27, 2015 at 12:52
A simple code to get value from attribute code
$attribute_code = "color"; 
$attributeValue = $_product->getAttributeText($attribute_code);
Explore related questions
See similar questions with these tags.