Kits & Associated SKUs

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
derekz
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 38
Joined: Mon Nov 03, 2008 3:13 pm

Kits & Associated SKUs

Post by derekz » Wed Dec 10, 2008 4:10 pm

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

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

Re: Kits & Associated SKUs

Post by mazhar » Thu Dec 11, 2008 6:24 am

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();

Post Reply