Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    129
    Plugin Contributions
    0

    Default [not a bug] Label missing on radio field if only one attribute is available

    I think it's a bug as all form items need to have labels for accesibility (screen readers)

    zc1.3.8a

    modules/attributes.php

    line 564
    PHP Code:
    $options_name[] = $products_options_names->fields['products_options_name']; 
    Should be replaced with
    PHP Code:
    $options_name[] = '<label class="attribsRadioButton" for="' 'attrib-' $products_options_names->fields['products_options_id'] . '-' $products_options_value_id '">' $products_options_names->fields['products_options_name'] . '</label>'

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Label missing on radio field if only one attribute is available

    Did you encounter a particular product attribute configuration which rendered an incorrect display? If so, please explain the exact configuration so it can be reproduced for proper evaluation.

    Or are you just analyzing code?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Label missing on radio field if only one attribute is available

    This is when a drop down attribute is set, for example Colour, and only one colour is entered, for example blue. Instead of rendering a drop down, the attribute option (blue) is shown as a selected radio option.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Label missing on radio field if only one attribute is available

    Using 1.3.8a with demo data, I selected "Test Eight" as the product, then added the "Documentation" (a [Dropdown] option) and "MS Word" for the value.

    The resultant HTML in the template renders as:
    HTML Code:
    <input type="radio" name="id[17]" value="63" checked="checked" id="attrib-17-63" /><label class="attribsRadioButton" for="attrib-17-63">MS Word - English</label>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Label missing on radio field if only one attribute is available

    Sorry Dr Byte, you're right this isn't a bug. In your test example "Documentation" is wrapped in a h4 when the only item is MS Word, however if you add another attribute, "MS Excel", "Documentation" is now wrapped in a label. I noticed this change as I had styled form labels, and when only one attribute appears there wasn't a label to take the formatting. Thanks for looking into this and hope I didn't waste your time.

 

 

Similar Threads

  1. Replies: 2
    Last Post: 16 Jan 2013, 05:07 AM
  2. dropdown changes to radio if only one attribute option
    By ivanc in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 26 Mar 2009, 09:43 PM
  3. Radio Button Label Attribute
    By gilesletheren in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Aug 2008, 04:02 AM
  4. Replies: 4
    Last Post: 7 Apr 2008, 03:52 PM
  5. Attributes - Multiple languages bug? < nop not the missing translation one!
    By Dexter in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 15 Jan 2008, 05:03 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