Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2007
    Posts
    54
    Plugin Contributions
    0

    Default dropdown changes to radio if only one attribute option

    where can this be disabled?

    thx

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: dropdown changes to radio if only one attribute option

    You would need to customize the attributes.php module to change that, as it is designed to not make the customer have to click the dropdown to discover there are no choices ...

    The case statement controlling this is at lines 559 - 569 and reads:
    Code:
                      // dropdown menu auto switch to selected radio button display
                      case ($products_options->RecordCount() == 1):
                      if ($show_attributes_qty_prices_icon == 'true') {
                        $options_name[] = '<label class="switchedLabel ONE" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'] . '</label>';
                      } else {
                        $options_name[] = $products_options_names->fields['products_options_name'];
                      }
                      $options_menu[] = zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, 'selected', 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<label class="attribsRadioButton" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_details . '</label>' . "\n";
                      $options_comment[] = $products_options_names->fields['products_options_comment'];
                      $options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
                      break;
    If that were commented out, then it will fall through to the default just below it and run like a standard dropdown with just the one choice ...

    Personal note, I hate clicking on a dropdown to find out there isn't another choice ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Dec 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: dropdown changes to radio if only one attribute option

    Quote Originally Posted by Ajeh View Post

    Personal note, I hate clicking on a dropdown to find out there isn't another choice ...
    thank you very much!

    yes..I see how that can be annoying...but I can't find any way to align the radio button/option value (when theres only one) to the option name

    option name and option value aren't in line, option name is always about a line or two higher, which doesn't look especially nice:

    * Red
    Color:

    I have managed to get it almost inline when using dropdown, so this is why I would prefer it...radio just won't budge

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: dropdown changes to radio if only one attribute option

    Most of the parts of the attribute display have tags that can be used to adjust them. I didn't like the default alignment of radiobuttons either. Try something like this in your stylesheet:
    Code:
    #productAttributes input { 
    	position: relative; 
    	bottom: -.4em;
    	}

  5. #5
    Join Date
    Dec 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: dropdown changes to radio if only one attribute option

    that was an excellent advice, it did the trick, I had to expand it a little to align the label and the dropdown also

    Code:
    #productAttributes input { 
    	position: relative;
    	bottom: -1.4em;
    }
    
    #productAttributes label { 
    	position: relative;
    	bottom: -1.2em;
    }
    
    #productAttributes select { 
    	position: relative;
    	bottom: -2.8em;
    }

    BUT now IE is not inline!

    it turns out that when this is not applied firefox is not inline, IE is ok, and vice versa when applied....

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: dropdown changes to radio if only one attribute option

    Sounds like a situation for a conditional comment or IE-specific stylesheet.
    The quick & dirty way for IE6 or earlier would be the * html hack:
    Code:
    * html #productAttributes input, * html #productAttributes label, * html #productAttributes select { 
    	position: static;
    }
    Put this after the previous rules. Since IE6 (erroneously) thinks there is an element that contains the overall html container, this rule will apply only to IE6.

  7. #7
    Join Date
    Dec 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: dropdown changes to radio if only one attribute option

    I don't know about IE6, but this unfortunately doesn't work for IE7 (which is the one I have the problem with)...

    also tried adding bottom:1em and bottom:none to see if something will be different, but no luck

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: dropdown changes to radio if only one attribute option

    You didn't say which version of IE you had the problem with, so I gave the easy hack I know. I haven't worked with IE conditional comments, but there is plenty of info about them on the web - google to see it.

    There is also a mod in Free Addons to allow you to apply them to Zen Cart.

  9. #9
    Join Date
    Dec 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: dropdown changes to radio if only one attribute option

    It seems that the new IE8 took care of almost all design differences with firefox, it reads the stylesheet almost completely in the same way....which is what I had hoped for

    thank you gjh for your help!

    for anyone who still needs this, here is a nice explanation on how to use conditional comments to make different stylesheets for different browser:
    http://webdevjunk.com/coding/css/4/u...iple-browsers/

 

 

Similar Threads

  1. v151 From multiple Option Names and Attributes allow user to select one attribute only
    By tipada in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 27 Jan 2013, 03:10 AM
  2. Option Values Dropdown displays as Radio Buttons
    By princessatron in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 26 Sep 2011, 02:47 AM
  3. Replies: 4
    Last Post: 22 Sep 2008, 09:45 AM
  4. Attribute Showing As Radio Set For Dropdown
    By LoveToBeCraftin in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 21 Aug 2008, 03:30 PM
  5. Disable attribute display when only one option
    By Woodymon in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 1 Jan 2007, 05:46 AM

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