title: Echo Tax Amount for all products in magento
body: <p>In magento, I want to echo the tax rate for each and every product in particular category in this way :</p>
  
  <pre><code>([{"id":"1","name":"Shirt","price":"45.00","tax":null}]);
  </code></pre>
  
  <p><strong>I used the following code:</strong></p>
  
  <pre><code>      public function ws_products($store_id, $service, $categoryid){
  
        $res=array();
  
        Mage::app()-&gt;setCurrentStore($store_id); 
  
    $c_id = $categoryid;
    $category = new Mage_Catalog_Model_Category();
    $category-&gt;load($c_id);
    $collection = $category-&gt;getProductCollection()-&gt;addStoreFilter($store_id);
    $collection-&gt;addAttributeToSelect('*');
  
  
  foreach ($collection as $_product) {
  $res[] = array(
    "id" =&gt; $_product-&gt;getId(),
    "name" =&gt; $_product-&gt;getName(),
    "price" =&gt; number_format($_product-&gt;getPrice(),2),
    "tax" =&gt; Mage::helper('checkout')-&gt;getQuote()-&gt;getShippingAddress()-&gt;getData('tax_amount'),
  
                             ); 
     } 
     return($res); 
  }
  </code></pre>
  
  <p>WHEN I AM USING </p>
  
  <pre><code>"tax" =&gt; Mage::helper('checkout')-&gt;getQuote()-&gt;getShippingAddress()-&gt;getData('tax_amount'),
  </code></pre>
  
  <p>I AM GETTING TAX AS NULL.</p>
  
  <p>Please kindly help me.</p>