0

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

asked Jul 27, 2015 at 10:32

2 Answers 2

0

Have you tried this?

$option_id = Mage::getResourceModel('catalog/product')
 ->getAttributeRawValue($prod_id, $attribute_code, $store_id); 
answered Jul 27, 2015 at 10:37
1
  • 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. Commented Jul 27, 2015 at 12:52
0

A simple code to get value from attribute code

$attribute_code = "color"; 
$attributeValue = $_product->getAttributeText($attribute_code);
answered Oct 20, 2017 at 5:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.