Page 1 of 1
Add Input Textbox field for a component in a Product Kit
Posted: Sun Feb 08, 2009 9:24 pm
by fatone
I have created a Product Kit, where I utilize dropdown boxes and radio buttons as components. I would like to have the customer enter some text that is needed for the order, but don't see a way to do it.
Is there any way to get some input text from the user specific to a product?
Thanks
Re: Add Input Textbox field for a component in a Product Kit
Posted: Mon Feb 09, 2009 3:06 am
by mazhar
You can create a product template with a customer field of type textbox. Then apply that template to the desired product for which you want to have the input field.
Re: Add Input Textbox field for a component in a Product Kit
Posted: Mon Feb 09, 2009 2:21 pm
by fatone
Thanks for the response! I did that and the text box shows up, but is there a way to format/align it better. It kind of looks weird in the display next to the other components. For example, the label is on one line and the textbox on the other. It would be nice for both to be on the same line, like the other components.
What files would I have to modify to format these fields better.
Re: Add Input Textbox field for a component in a Product Kit
Posted: Tue Feb 10, 2009 4:24 am
by mazhar
For this you need a small modification in App_Code/ProductHelper.cs file. Edit the file and locate the
public static void BuildProductChoices(Product product, PlaceHolder phChoices) function. Then find the following line of code in this function
Code: Select all
phChoices.Controls.Add(new LiteralControl((input.UserPrompt + "<br />")));
and make it look like
Code: Select all
phChoices.Controls.Add(new LiteralControl((input.UserPrompt + " : ")));
Save the changes and test again the product details page.