tuan
9/1/2015 - 8:56 AM

Delete all product belong to category

Delete all product belong to category

<?php

$deleteAllProduct = function() {
    $products = Mage::getModel('catalog/product')->getCollection();
    foreach ($products as $product) {
        try {
            $product->delete();
        } catch(Exception $e) {
            echo "Product #".$product->getId()." could not be remvoved: ".$e->getMessage();
        }
    }
};

//$deleteAllProduct();