title: delete cart since cronjob in Magento
body: <p>Hi i thy to delete all cart of customer, i don´t get it since cornjob, i put this in a controller and work fine</p>
  
  <pre><code>    require_once($_SERVER['DOCUMENT_ROOT'].'/app/Mage.php');
  $app = Mage::app();
  Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
  
  Mage::getSingleton('checkout/session')-&gt;clear(); // Try this
  
  foreach( Mage::getSingleton('checkout/session')-&gt;getQuote()-&gt;getItemsCollection() as $item ){
   Mage::getSingleton('checkout/cart')-&gt;removeItem( $item-&gt;getId() )-&gt;save(); // or try that
  }
  
  header('Location: /'); // send them back to root (or /magento/ if stored in a subfolder)
  </code></pre>
  
  <p>or </p>
  
  <pre><code>foreach( Mage::getSingleton('checkout/session')-&gt;getQuote()-&gt;getItemsCollection() as $item ){
  Mage::getSingleton('checkout/cart')-&gt;removeItem( $item-&gt;getId() )-&gt;save();
  }
  </code></pre>
  
  <p>but don´t work in a cron. 
  who is the problem?</p>