title: Updating Magento Attribute Programmatically
body: <p>I have been writing a script that updates my attribute <code>add_ten_pence</code>, the attribute is a yes/no boolean value. At the moment it goes through the <code>SKU's</code> in the database but unfortunately it's not updating the database. I have pasted the script below does anyone know where I'm going wrong?</p>
  
  <p>The attribute is set to 'No' as default, and I wish to change it to 'Yes' when the script runs, and vice versa.</p>
  
  <pre><code>require_once('app/Mage.php');
  
  umask(0);
  Mage::app('default');
  Mage :: app ()-&gt;setCurrentStore(Mage_Core_Model_App :: ADMIN_STORE_ID);
  $productCollection = Mage::getModel('catalog/product')-&gt;getCollection();
  
  foreach($productCollection as $_product) 
  {
      echo "\n".'updating '.$_product-&gt;getSku()."...\n";
      $product = Mage::getModel('catalog/product')-&gt;load($_product-&gt;getEntityId());
      $product-&gt;setAddTenPence(true);
      $product-&gt;save();
  }
  </code></pre>