Page 1 of 1
Cloning Variants and Templates for a large list of products
Posted: Sun Nov 14, 2010 6:45 am
by pongguru
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.
Re: Cloning Variants and Templates for a large list of products
Posted: Mon Nov 15, 2010 6:26 am
by s_ismail
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();
}
Re: Cloning Variants and Templates for a large list of products
Posted: Mon Nov 15, 2010 7:37 am
by jmestep
If you haven't entered the new products, you could copy the first one, then change name, price, sku, etc.