How to remove all items in a magento product collection?

In the following code we are going to study how to remove all items in a Magento Product Collection in a simple way.


$Collection = Mage::getModel('catalog/product')->getCollection()
         foreach( $collection as $item )//product
       {
                      $item->delete();
                }

This code will delete or truncate all items in Magento product collection

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *