Page 1 of 1

Kit Component SKUs on Basket.aspx

Posted: Tue Jul 28, 2009 12:36 pm
by jdarby
When a user adds a kit to their cart that is made up of components with unique SKUs, only the master product's SKU (if it has one) is displayed on Basket.aspx in the SKU column. Is there a way to make the kit component item's SKUs also display in the SKU column?

Re: Kit Component SKUs on Basket.aspx

Posted: Wed Jul 29, 2009 10:03 am
by mazhar
In App_Code/ProductHelper.cs file update GetSKU method as below

Code: Select all

public static string GetSKU(BasketItem item)
    {
        switch (item.OrderItemType)
        {
            case OrderItemType.Product:
                if (item.Product.KitStatus == KitStatus.Master)
                {
                    string sku = item.Sku+",";
                    List<KitProduct> kitProducts = item.GetKitProducts();
                    foreach (KitProduct kitProduct in kitProducts)
                        if(!string.IsNullOrEmpty(kitProduct.Product.Sku))
                            sku += kitProduct.Product.Sku+",";
                    if (sku.EndsWith(","))
                        sku = sku.Remove(sku.Length - 1, 1);
                    return sku;
                }
                return item.Sku;
            case OrderItemType.GiftWrap:
                return "GIFT WRAP";
            case OrderItemType.Coupon:
                return "COUPON";
            case OrderItemType.Discount:
                return "DISCOUNT";
            case OrderItemType.Shipping:
                return "SHIPPING";
            case OrderItemType.Handling:
                return "HANDLING";
            case OrderItemType.Tax:
                return "TAX";
            case OrderItemType.GiftCertificatePayment:
                return "GIFTCERT PAYMENT";
            case OrderItemType.Charge:
                return "CHARGE";
            case OrderItemType.Credit:
                return "CREDIT";
            case OrderItemType.GiftCertificate:
                return "GIFTCERT";
            default:
                return string.Empty;
        }
    }

Re: Kit Component SKUs on Basket.aspx

Posted: Wed Jul 29, 2009 1:58 pm
by jdarby
i'm receiving the error:

Line 14: using CommerceBuilder.Web.UI.WebControls;
Line 15:
Line 16: public class ProductHelper
Line 17: {
Line 18: /// <summary>

Re: Kit Component SKUs on Basket.aspx

Posted: Wed Jul 29, 2009 2:05 pm
by jdarby
Got the error resolved. Seems to be displaying the same results on Basket.aspx. I don't get the SKUs of the kit components, just the master kit product.

UPDATE: I am getting the SKU of the component product. However, the component product has size options. So, I have a master product setup (with no SKU) and it has sizes (small, medium, large) each with a separate SKU modifier. Any way to display those? Thanks.