I understand how you build a Kit off a master product. That master product has a SKU assigned to it. You then add your components, etc...and you're ready to go. My question is, can you determine a SKU based off the components you add. For instance, let's say I have master product SKU 721-0001. Based off of the components I choose, I would like my SKU to change to 721-0001-1.
Is this possible?
Thanks
Kits & Associated SKUs
Re: Kits & Associated SKUs
You may try to provide some code to auto generate the SKU for the child products. Something like below.
Code: Select all
string[] parts = masterProduct.Sku.Split('-');
int childPart = AlwaysConvert.ToInt(parts[2]);
childPart++;
string childSku = "{0}-{1}-{2}";
childSku = String.Format(childSku, parts[0], parts[1], childPart);
childProduct.Sku = childSku;
childProduct.Save();