Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Drop down with only one value in attribute

Drop down with only one value in attribute

Locked

Views: 1,256

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 Dec 2007, 4:47 AM
#1
justinae avatar

justinae

New Zenner

Join Date:
Nov 2007
Posts:
27
Plugin Contributions:
0

Drop down with only one value in attribute

I only have one color option for an item but don't want it to be a radio button. I still want it to have a drop down menu, but with just the one item. I experimented with adding another color and sure enough it gives me the drop down menu. So is it a setting or something else.

You can see the site here: www.pedxshoes.com/index.php

I'm using the latest zencart.

thank you,
Justin

5 Dec 2007, 8:36 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Drop down with only one value in attribute

By default, dropdowns with only one option are displayed as radiobuttons. There is not a setting for this, but it should be possible to disable the switch somewhere in the PHP code.

6 Dec 2007, 4:55 AM
#4
justinae avatar

justinae

New Zenner

Join Date:
Nov 2007
Posts:
27
Plugin Contributions:
0

Re: Drop down with only one value in attribute

Good to know. Thank you.

6 Dec 2007, 5:08 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Drop down with only one value in attribute

To change the behavior of Option Names that are dropdowns with only 1 Option Value where it switches automatically to a selected Radio button so that customers do not waste time clicking the dropdown to discover that there are no other options ...

You would need to customize the attributes.php module and comment out this whole case statement:

                  // 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;