I'm wondering if there's a right way to get the value of a product attribute, in a generic way.
EDIT: Or whatever I can use to get the info from a dropdown or text field using the same mechanism
I know I can do:
But if the code it's a dropdown select then I'll be getting a value which doesn't represent really what the users selected. For example in a dropdown to select a t-shirt size options would be (s,l,xl) and internal values (1,2,3)
It's a way to know how to get the attribute type to later identify what I should be looking for or the right way to pick the value.