Product Template Mass Deletion

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
andy
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Mar 16, 2009 12:48 pm

Product Template Mass Deletion

Post by andy » Fri Jul 17, 2009 2:58 pm

Hey guys,

Why we had all of our data moved from AC5.5 to AC7 they some how made a product template for each and every product. So, there's like 5k of them. Is there a way to delete all of them and start over?

Thanks,
Andy

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Product Template Mass Deletion

Post by mazhar » Mon Jul 20, 2009 2:23 am

You can try following code to delete all product templates from your store.

Code: Select all

CommerceBuilder.Products.ProductTemplateCollection templates = CommerceBuilder.Products.ProductTemplateDataSource.LoadForStore();
        foreach (ProductTemplate template in templates)
            template.Delete();
Put it somewhere in your store on some page, for example on Product Templates page at some button event.

andy
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Mar 16, 2009 12:48 pm

Re: Product Template Mass Deletion

Post by andy » Mon Jul 20, 2009 12:01 pm

Thanks Mazhar,

Could you elaborate any?

andy
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Mar 16, 2009 12:48 pm

Re: Product Template Mass Deletion

Post by andy » Mon Jul 20, 2009 12:34 pm

Never mind,

Just figure it out.

Thanks again!

Post Reply