protected void GetSelectedKitOptions(Product product)
        {
            _SelectedKitProducts = new List <int>();
            //COLLECT ANY KIT VALUES
            foreach (ProductKitComponent pkc in product.ProductKitComponents)
            {
                // FIND THE CONTROL
                KitComponent component = pkc.KitComponent;

                if (component.InputType == KitInputType.IncludedHidden)
                {
                    foreach (KitProduct choice in component.KitProducts)
                    {
                        _SelectedKitProducts.Add(choice.Id);
                    }
                }
                else
                {
                    System.Web.UI.WebControls.WebControl inputControl = (System.Web.UI.WebControls.WebControl)AbleCommerce.Code.PageHelper.RecursiveFindControl(phOptions, component.UniqueId);
                    if (inputControl != null)
                    {
                        IList <int> kitProducts = component.GetControlValue(inputControl);
                        foreach (int selectedKitProductId in kitProducts)
                        {
                            _SelectedKitProducts.Add(selectedKitProductId);
                        }
                    }
                }
            }
        }
        public static List <int> BuildKitOptions(Product product, PlaceHolder phOptions, bool ignoreInventory)
        {
            List <int> selectedChoices = new List <int>();

            foreach (ProductKitComponent pkc in product.ProductKitComponents)
            {
                KitComponent component = pkc.KitComponent;
                if (component.InputType != KitInputType.IncludedHidden && component.KitProducts.Count > 0)
                {
                    // CREATE A LABEL FOR THE ATTRIBUTE
                    phOptions.Controls.Add(new LiteralControl("<tr><th class=\"rowHeader\">" + component.Name + ":</th>"));
                    // ADD THE CONTROL TO THE PLACEHOLDER
                    phOptions.Controls.Add(new LiteralControl("<td align=\"left\">"));
                    WebControl o = component.GetControl(ignoreInventory);
                    if (o != null)
                    {
                        Type oType = o.GetType();
                        if (oType.Equals(typeof(RadioButtonList)))
                        {
                            ((RadioButtonList)o).AutoPostBack = true;
                        }
                        else if (oType.Equals(typeof(DropDownList)))
                        {
                            ((DropDownList)o).AutoPostBack = true;
                        }
                        else if (oType.Equals(typeof(CheckBoxList)))
                        {
                            ((CheckBoxList)o).AutoPostBack = true;
                        }
                        phOptions.Controls.Add(o);
                        // SEE WHETHER A VALID VALUE FOR THIS FIELD IS PRESENT IN FORM POST
                        IList <int> theseOptions = component.GetControlValue(o);
                        selectedChoices.AddRange(theseOptions);
                    }
                    phOptions.Controls.Add(new LiteralControl("</td></tr>"));
                }
            }
            return(selectedChoices);
        }