Cloning Variants and Templates for a large list of products

A forum where issues related to the DataPort utility can be discussed.
Post Reply
User avatar
pongguru
Ensign (ENS)
Ensign (ENS)
Posts: 8
Joined: Sun Nov 14, 2010 6:07 am

Cloning Variants and Templates for a large list of products

Post by pongguru » Sun Nov 14, 2010 6:45 am

I have a category and the products under that category has the same product variants and product templates. Now I have created just one product, how can I clone the same variant and template for some 25 products? I don't want to go through the pain of creating the variant and template for all the new 24 other products.

User avatar
s_ismail
Commander (CMDR)
Commander (CMDR)
Posts: 162
Joined: Mon Nov 09, 2009 12:20 am
Contact:

Re: Cloning Variants and Templates for a large list of products

Post by s_ismail » Mon Nov 15, 2010 6:26 am

You may write a custom script to get this functionality like this

Code: Select all

 
    List<Product> products = ProductDataSource.NarrowSearch(string.Empty, Category_id, 0, 0, 0, 0, 0, string.Empty);
        foreach (Product product in products)
        {
            Option option = new Option();
            option.ProductOptions.Add(new ProductOption(product.ProductId, 0));
            option.Name = "Option_Name";
            option.Save();
            OptionChoice optChoice = new OptionChoice();
            optChoice.Name = "Variant_Name";
            optChoice.OptionId = option.OptionId;
            optChoice.Save();
        }

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Cloning Variants and Templates for a large list of products

Post by jmestep » Mon Nov 15, 2010 7:37 am

If you haven't entered the new products, you could copy the first one, then change name, price, sku, etc.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply