Page 1 of 1

Dynamic Product Templates

Posted: Tue Mar 31, 2009 10:05 am
by cgreathouse
Hello

Is it possible to make Product Templates dynamic? Here's what I'm trying to do...

I have a template that has 3 radio options and 5 text boxes. Depending on what radio option is selected, some of the text boxes will be visible and some will be hidden.

Example:

Selected Visible

Radio1 Text1, Text2, Text5
Radio2 Text2, Text4, Text5
Radio3 Text1, Text3, Text4

Is that possible to do? If this can be done through changing some source, can you point me at what files/functions that would need to be changed?

Thanks!

Re: Dynamic Product Templates

Posted: Tue Mar 31, 2009 10:22 am
by mazhar
Well If this show/hide setup is same for all products then you may try to customize

Code: Select all

BuildProductChoices(Product product, PlaceHolder phChoices)
method of App_Code/ProductHelper.cs file. If this is not the case means each product may have its own show/hide setup then following posts may be helpful
viewtopic.php?f=42&t=7746&p=32975
viewtopic.php?f=42&t=7808

Re: Dynamic Product Templates

Posted: Tue Mar 31, 2009 10:38 am
by cgreathouse
Thanks!

I think modifying BuildProductChoices is what I need. After looking at the source, it's not obvious to me what I need to do to get the text boxes to toggle between being visible and hidden based on the radio option selected.

Do you have any code snippets that demonstrates how to do this?

Thanks!

Re: Dynamic Product Templates

Posted: Wed Apr 01, 2009 6:25 am
by cgreathouse
Does anybody know how to do this? If this isn't possible I could try having another page that has the text boxes. That would make the flow of adding an item to the cart not as nice though.