title: Magento Shipping Module: Get all items currently in cart
body: <p>I'm in the middle of developing a shipping module for Magento but get stuck on How to get the items that's currently in the cart for that session.</p>
  
  <p>I follow some tutorial on the internet, they use:</p>
  
  <pre><code>if ($request-&gt;getAllItems()) { 
      foreach ($request-&gt;getAllItems() as $item) {
        //do something here.....
  
      }
  }
  </code></pre>
  
  <p>My problem is that <strong>I don't know exactly what info/data that's on the $item variable??</strong>.</p>
  
  <p>I want to get the weight and the price of the product that's currently on the cart to calculate the shipping fee. I tried to print the $item value by using <strong>Mage::log</strong> or printing it to the screen using <code>print_r</code> or <code>var_dump</code> but it's not successful. The log is empty and the variable won't be printed on screen.</p>
  
  <p>Can somebody inform me of how to get the <code>$item attributes/method</code> or is there any other way to get the product information that's currently in cart?</p>
  
  <p>Any help would be much appreciated :)</p>