Selective bulk eCommerce product deletion

Permalink
We're looking for a php developer who knows Concrete5 eCommerce to create a product deletion Job that will remove all products and associated images from a store with the exception of those within two or three specific categories.

The store has 4,500 products so this cannot be done manually.

There is code already within the forum to delete all product which will probably be a good starting point for this:

<?
Loader::model('product/list','core_commerce');
$productList = new CoreCommerceProductList();
$products = $productList->get(100);
while(is_array($products)&& count($products)){
   foreach($products as $product) {
      $product->delete();
      echo "Deleted some stuff... ";
   }
   $products = $productList->get(100);
}
echo "\nNo more ducks!(or anything else you might have had in your store...)";

katalysis
 
hutman replied on at Permalink Reply
hutman
Are you just looking for someone to build you a command line script that will do this for you? If you try to do this through the "Automated Jobs" panel in the C5 Dashboard it will most certainly timeout with that many products to filter through.

Are you looking for something where you have some kind of interface to select which "categories" are not deleted, or can that be hard coded into the script?

When you say "categories" what are you really talking about, since eCommerce doesn't have Product Categories, are you talking about Product Sets or having a certain Product Attribute?
katalysis replied on at Permalink Reply
katalysis
We've found someone for this job now - thanks to all who PM'd