Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Radio Buttons/unlimited quantity

Radio Buttons/unlimited quantity

Locked

Views: 1,970

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
5 Jul 2007, 9:15 PM
#1
jaredbbauer avatar

jaredbbauer

New Zenner

Join Date:
May 2007
Posts:
10
Plugin Contributions:
0

Radio Buttons/unlimited quantity

I have products that I never run out of and I do not want to have to worry about quantity and sold out signs on my site. How do I do this?

Also, I am clicking on dropdown under option name manager, but it just keeps coming up as a radio button. And they are all selected how do I fix this so that they have to choose one of the options and they are in a dropdown menu????

Jared

PS - Thank you so much for your help!

5 Jul 2007, 10:16 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Radio Buttons/unlimited quantity

In admin > Configuration > Stock, set
Check stock level to false, and
Subtract stock to false.
You may also want to set
Allow Checkout to true.

It sounds like you are configuring the dropdown wrong. If there is only one value for a dropdown option name, it will show as a selected radiobutton. When there is more than one valur, it will switch to displaying as a dropdown.

You are making each choice a separate option name; you need to use one option name, and create all of its possible option values under that.
If you want the customer to make a conscious choice and not just accept a default, you can make another option value under the option name, called "Select" or whatever, and add it in Attribute Controller. In the row of brightly colored boxes, set "Select" as Default and Display Only.

25 Sep 2007, 3:26 AM
#3
donplay avatar

donplay

New Zenner

Join Date:
Jun 2007
Posts:
72
Plugin Contributions:
0

Re: Radio Buttons/unlimited quantity

gjh42:

In admin > Configuration > Stock, set
Check stock level to false, and
Subtract stock to false.
You may also want to set
Allow Checkout to true.

It sounds like you are configuring the dropdown wrong. If there is only one value for a dropdown option name, it will show as a selected radiobutton. When there is more than one valur, it will switch to displaying as a dropdown.

Does anyone know how to change this behavior? I would like to have the option remain as a drop-down with only one option to keep the interaction consistent.

thanks,
Don

25 Sep 2007, 3:27 AM
#4
donplay avatar

donplay

New Zenner

Join Date:
Jun 2007
Posts:
72
Plugin Contributions:
0

Re: Radio Buttons/unlimited quantity

donplay:

Does anyone know how to change this behavior? I would like to have the option remain as a drop-down with only one option to keep the interaction consistent.

thanks,h
Don

"I would like to have the option remain as a drop-down with only one value" is what I meant to say...thanks!

25 Sep 2007, 8:06 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Radio Buttons/unlimited quantity

That will requre some coding deep within the workings of Zen Cart. There is no switch for it. If you do change it, consider carefully where else the change might show up beside product info pages, and whether that will be good.

25 Sep 2007, 12:06 PM
#6
donplay avatar

donplay

New Zenner

Join Date:
Jun 2007
Posts:
72
Plugin Contributions:
0

Re: Radio Buttons/unlimited quantity

Hi gjh42,

Thanks for the response. Do you have any idea where that change would be? What other major impact could you forsee it affecting?

I would do the change on my test server first and check the impact in other areas but any pointers I can have would be helpful.

thanks,
Don

25 Sep 2007, 2:53 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Radio Buttons/unlimited quantity

You would need to alter the module for the attributes.php ...

However, the reason this was done when a Dropdown contained only one value is that it gets obnoxious to click Dropdowns that have no choices ...

The code does automatically switch back to Dropdown as soon as there is more the one option value ...

This case statement would need to be turned off to allow the dropdown to processes as a dropdown regardless of how many option values there are:

                  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;
25 Sep 2007, 3:36 PM
#8
donplay avatar

donplay

New Zenner

Join Date:
Jun 2007
Posts:
72
Plugin Contributions:
0

Re: Radio Buttons/unlimited quantity

Thanks Ajeh for direction on where to find this logic. Much appreciated! I will give it a shot.

The current logic replacing the drop down with a radio button makes a lot of sense...I understand why it was put in as single-choice dropdowns are a bit annoying. However the feeling with the store owner I am working with is that they would like to keep the interaction consistent whether there is one size or more than one size available.

Thanks to Ajeh and gjh42 for all the help!

25 Sep 2007, 7:58 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Radio Buttons/unlimited quantity

I wasn't sure where the logic was located. Since it is confined within the attributes module, there should be no overspill of effects.

25 Sep 2007, 8:03 PM
#10
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,644
Plugin Contributions:
0

Re: Radio Buttons/unlimited quantity

( just thinking out loud, but if you only have one choice for size (as an example) why would you force your customer to make a choice at all? ... Very un-friendly to your customers )