Well I have this code here and I am adding it to my list.phtml
file to try and get the attribute text for each product to display:
<?php echo $_product->getAttributeText('mileage') ?>
This code works with any attribute that has a Catalog Input Type for Store Owner
value of dropdown
however it does not display for attributes with the value of Text Field
.
Any idea why this might be happening?
I have the setting Used in Product Listing
enabled for both attributes.
Thanks
getAttributeText()
method is specifically there for dropdown type attributes. If you take a look at the method in Product model, you'll find that the method gets value index from Product data and then, finds the text for that index in respective table.