title: magento > how to get _defaultValues:protected
body: <p>i use this code to get product prices from magento:</p>
  
  <pre><code>include_once '../../app/Mage.php';
  Mage::app();
  $model = Mage::getModel('catalog/product');//getting product model
  $collection = $model-&gt;getCollection(); //products collection
  foreach ($collection as $product) //loop for getting products
  {                  
      $model-&gt;load($product-&gt;getId());
      echo $model['price'];
  }
  </code></pre>
  
  <p>so, when i use this script, for some products, the right prices is given, but for some products it is not the right price. </p>
  
  <p>when i var_dump() the $model->load($product->getId()); the right price is always in here:</p>
  
  <pre><code>["_defaultValues:protected"]=&gt;
    array(5) {
      ["special_price"]=&gt;
      string(7) "32.0000"
      ["visibility"]=&gt;
      NULL
      ["status"]=&gt;
      string(1) "1"
      ["price"]=&gt;
      string(8) "399.9900"
      ["name"]=&gt;
      string(51) "Philips Home cinema met 3D Blu-ray iPod/iPhone-dock"
    }
  </code></pre>
  
  <p>How to change to code to get this 399,99 price, instead of the '1' I get when using $model['price']?</p>