Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    368
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default 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...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2009
    Posts
    368
    Plugin Contributions
    0

    Default 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.

    Name:  Selection_002.png
Views: 110
Size:  13.8 KB

    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

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. How to display lightbox directly from Product listing? (no product detail page)
    By y2caye in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Jan 2010, 03:38 AM
  2. Need to display manufacturer name in product detail page
    By tabor.carlton in forum General Questions
    Replies: 4
    Last Post: 18 Sep 2009, 02:59 AM
  3. Replies: 1
    Last Post: 29 Mar 2007, 12:11 AM
  4. Need to send product specific detail in confirmation email
    By kallel in forum General Questions
    Replies: 10
    Last Post: 9 Aug 2006, 01:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR