I need a special dropdown at product detail page
I have some products for which I have to display a dropdown containing names, alphabetical order. In case name is not present in list, customer must choose "not in list" value, than an input text must show up in order to insert his name as text. That value must be displayed in cart and at checkout as other options already do this.
Is there any module doing this ? Do I need something custom ?
thx
Re: I need a special dropdown at product detail page
I don't know of any such per se existing module that does this and can think of a few ways to implement, though it seems like javascript/jquery will be in use and for when it's not available that this option would be present to just enter the name. So thinking a dropdown that is generated when this product type is present, the product has a text box with text being required. When javascriopt/jquery is active, the text box is hidden unless the "not listed" option is selected. When a name is selected the name is pushed/transferred into the text box, otherwise the typed name is what is there. This will keep the name with the product throughout checkout. If once at the shopping cart and they return back to the product (click the product in the shopping cart) then the list would be looked up for the existing name, if not found then set the active option to the "not listed" option and the text box populated with the name.
Another "option" being two attributes associated with the product. One a list of names, the other a text box. Then only so much javascript/jquery as necessary to show/hide the text box based on the selection of the "dropdown". The options in the dropdown should not be display only except for the single "please choose a name" if that is used. The "not listed" name needs to be selectable as an option to save. The text box then would not be a required field because if there is nothing to always populate it, then it would be empty when selecting from the dropdown and have something only when 1) "not listed" is selected AND text is entered... (would require some sort of validation if a name must always be present/selected).
Then there's the matter of the name list getting updated if that is a requirement. Outside of ZC there are a few handy searchable list boxes that can be populated from whatever array of data is provided, but that definitely is custom coding. :)
Just some ideas. Hopefully someone knows of a plugin that fits your needs so that there is only some minor modifications necessary and not full development...
1 Attachment(s)
Re: I need a special dropdown at product detail page
@mc - thank you for your analysis, definitely useful for how will try to do that.
Attachment 17374
I found a compromise, but I still need a brilliant solution:
In the picture attached I need to change styles of points 1, 2 ( marked with red ) and for doing that I have to play with css of optionValueHtml and optionValueHtml classes. I would like to give 2 different class names only for those divs where option name is let's say "select your name" .
Is that possible ?
thx
Re: I need a special dropdown at product detail page
So if your attributes are assembled using default ZC "rules" then knowing the option name id (identified next to the option name in the catalog->option names manager) will allow you to use the css that is referred to in this post: https://www.zen-cart.com/showthread....Only-Attribute to be able to style/modify the dropdown or other attribute that is generated. I would suggest also reviewing the css styling guide/readme found in includes/templates/template_default/css so that the css can be applied to the page(s) necessary. Note: any product that uses the same option name (by option id) will have the same css identifier making consistent styling easier.