Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default remove radiobutton when just one attribute

    Hello everyone!!

    It is something which could be really easy but I can't figure out. I choose the drop down menu to display my attributes.

    I want to remove the radiobutton next to the attribute when there is just one attribute. I don't know how to do it
    thanks for any ideas!! I really appreciate !!

    F.

  2. #2
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: remove radiobutton when just one attribute

    I still can't find where I can change it..someone has any idea?

    Thanks a lot..

  3. #3
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: remove radiobutton when just one attribute

    I am soo sorry to bother you again but I have NOO clue about this issue.

    Any help?

    thanks

  4. #4
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: remove radiobutton when just one attribute

    I feeeeel sooo looonely...
    I tried to edit "attribute.php" but I still keep the radiobutton in front of my attribute.

    Has someone did it or have any idea ?
    thanks

    F.

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

    Default Re: remove radiobutton when just one attribute

    Currently, Option Groups as dropdowns with 1 Option Value are converted to automatically selected radio buttons ...

    You would need to customize the attributes.php module ...

    I think I may have a post somewhere over the last month or so on how to do this ...
    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!

  6. #6
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: remove radiobutton when just one attribute

    Thank you Ajeh...I tried to find your old post but I can not find it...
    Arg I know I am a bit stupid...

    Thanks again

    F.

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

    Default Re: remove radiobutton when just one attribute

    I can never find my old posts either ...

    but it's out there ...

    However, being the nice person that I am and since others may need to find how to allow Option Names with a Single Options Value you can look in the attributes module:
    /includes/modules/attributes.php

    There is a section that controls in the case statement for the Options Names Option Type where you have set it up to be a dropdown but have only one option value and this, by default, is switching that dropdown to the selected radiobutton so the customer does not waste the time clicking a 1 option value option name ...

    However, I digress ...

    Look at the section for:
    PHP 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 you comment out that whole case then it will not run and the single option value on the dropdown option type will now switch back to a dropdown and not a radio button ...

    Commenting it is easy ... just copy the file to your overrides directory:
    /includes/modules/your_template_dir/attribute.php

    and change the code to read:
    PHP 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;
    */ 
    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!

  8. #8
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: remove radiobutton when just one attribute

    Thanks, it works fine like that!

    I just wanted to know if it is possible to have just the attribute written(not in the drop down menu) when there is one attribute choice.

    Thanks again for all your help,

    F.

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

    Default Re: remove radiobutton when just one attribute

    It probably would of been easier to customize the change from dropdown to RadioButton to be a hidden selection when only 1 exists ...

    I haven't had time to write this code for you but that would be the area in which to do it ...
    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!

  10. #10
    Join Date
    Dec 2007
    Location
    brighton UK
    Posts
    40
    Plugin Contributions
    0

    Default Re: remove radiobutton when just one attribute

    did anyone come up with an answer to this one?

    I too would like just the one attribute to be displayed without a radio button...

    and without a dropdown - just so the text is echoed out on the page ...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 How do i stock based on attribute or remove attribute one sold
    By vvomble in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 18 Sep 2015, 04:29 PM
  2. Attribute Image Swap - but not just one!
    By TheTeeShack in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 29 Nov 2013, 07:00 PM
  3. how do I copy just one attribute to all other products?
    By denniszc in forum General Questions
    Replies: 2
    Last Post: 12 Apr 2013, 04:25 AM
  4. v139h Price by Attribute issue affecting all products when one attribute is out of stock.
    By NCRS 1962 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Dec 2012, 02:11 AM
  5. Copying just one attribute to all products
    By ckosloff in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 21 Jul 2008, 06:31 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