title: magento product collection by name
body: <pre><code>  &lt;?php
  $needle= $_GET["singleid"];
  
  $collection = Mage::getModel('catalog/product')-&gt;getCollection()-&gt;load();
  
  $_productCollection = $collection-&gt;addAttributeToFilter('name', array(
      array('like' =&gt; '% '.$needle.' %'), //spaces on each side
      array('like' =&gt; '% '.$needle), //space before and ends with $needle
      array('like' =&gt; $needle.' %') // starts with needle and space after
  ));
  foreach ($_productCollection as $_product){
     echo $_product-&gt;getId().'&lt;/br&gt;';
     echo $_product-&gt;getName().'&lt;/br&gt;';
     **echo $_product-&gt;getProductUrl().'&lt;/br&gt;';**//getting this only
     echo $_product-&gt;getPrice().'&lt;/br&gt;';
  }
  
  ?&gt;
  </code></pre>
  
  <p>I am trying to get product collection based on product name but I get only product URL.  I am trying get other attributes like name. My purpose is to create a search page.</p>