title: Show product attributes in list.phtml - Magento
body: <p>Hello I have read many posts about this, and while it works its not complete.</p>
  
  <p>For example; Attribute 1= shoesize and attribute 2 = shoe color.
  Both are in a dropdown and I would like to list all of the possible attribute colors per product within the category pages.</p>
  
  <p>Problem: When I test the code it will only display the first shoe color, instead of all posibilites. What am I doing wrong here?</p>
  
  <p>Here are 3 examples of what I have. All code work, but only shows the first attribute color.
  Example 1:</p>
  
  <pre><code>&lt;!-- Find the following loop --&gt;
  &lt;?php foreach ($_productCollection as $_product): ?&gt;
  &lt;!-- Inside it insert one of the following codes as needed --&gt;
  &lt;!-- Use this for regular text attributes --&gt;
  &lt;?php echo $_product-&gt;getMyAttribute() ?&gt;
  &lt;?php echo $_product-&gt;getAnotherCustomAttribute() ?&gt;
  
  &lt;!-- Use this for dropdown attributes --&gt;
  &lt;?php echo $_product-&gt;getAttributeText('shoecolor') ?&gt;
  &lt;?php endforeach?&gt;
  &lt;!-- ... --&gt; 
  </code></pre>
  
  <p>Example 2</p>
  
  <pre><code>&lt;?php echo $_product-&gt;getResource()-&gt;getAttribute('shoecolor')-&gt;getFrontend()-&gt;getValue($_product) ?&gt;
  </code></pre>
  
  <p>Example 3 </p>
  
  <pre><code>&lt;?php $type = "simple"; $p = "0" ?&gt; 
  &lt;?php foreach ($_productCollection as $_product): ?&gt; 
  &lt;?php $custom = Mage::getModel('catalog/product_type_configurable')-&gt;setProduct($_product); ?&gt; 
  &lt;?php $col = $custom-&gt;getUsedProductCollection()-&gt;addAttributeToSelect('shoecolor')-&gt;addFilterByRequiredOptions(); ?&gt; 
  &lt;?php foreach($col as $simple_product) { $p=$simple_product-&gt;getId(); $type="configurable"; } ?&gt; 
  
  &lt;?php if($type == "configurable"): ?&gt; 
  &lt;h5&gt;&lt;?php echo $_product-&gt;load($p)-&gt;getAttributeText('shoecolor'); ?&gt;&lt;?php $type="simple" ?&gt;&lt;/h5&gt; 
   &lt;?php endif; ?&gt; 
  </code></pre>