Kit Component SKUs on Basket.aspx

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
jdarby
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Thu Sep 25, 2008 2:21 pm

Kit Component SKUs on Basket.aspx

Post by jdarby » Tue Jul 28, 2009 12:36 pm

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?

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

Re: Kit Component SKUs on Basket.aspx

Post by mazhar » Wed Jul 29, 2009 10:03 am

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;
        }
    }

jdarby
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Thu Sep 25, 2008 2:21 pm

Re: Kit Component SKUs on Basket.aspx

Post by jdarby » Wed Jul 29, 2009 1:58 pm

i'm receiving the error:

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

jdarby
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Thu Sep 25, 2008 2:21 pm

Re: Kit Component SKUs on Basket.aspx

Post by jdarby » Wed Jul 29, 2009 2:05 pm

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.

Post Reply