Add Input Textbox field for a component in a Product Kit

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
fatone
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 38
Joined: Thu Jan 17, 2008 7:35 am

Add Input Textbox field for a component in a Product Kit

Post by fatone » Sun Feb 08, 2009 9:24 pm

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

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

Re: Add Input Textbox field for a component in a Product Kit

Post by mazhar » Mon Feb 09, 2009 3:06 am

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.

fatone
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 38
Joined: Thu Jan 17, 2008 7:35 am

Re: Add Input Textbox field for a component in a Product Kit

Post by fatone » Mon Feb 09, 2009 2:21 pm

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.

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

Re: Add Input Textbox field for a component in a Product Kit

Post by mazhar » Tue Feb 10, 2009 4:24 am

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.

Post Reply