Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attribute radio buttons class names incorrect? #6096

Open
torvista opened this issue Dec 24, 2023 · 4 comments
Open

attribute radio buttons class names incorrect? #6096

torvista opened this issue Dec 24, 2023 · 4 comments
Labels
[Issue Type] Documentation Updates needed to the docs

Comments

@torvista
Copy link
Member

case '0':
$tmp_radio .= zen_draw_radio_field('id[' . $products_options_id . ']', $products_options_value_id, $selected_attribute, 'id="' . $inputFieldId . '" ' . $data_properties . $field_disabled) . '<label class="attribsRadioButton zero" for="' . $inputFieldId . '">' . $products_options_details . '</label><br>' . "\n";
break;
case '1':
$tmp_radio .= zen_draw_radio_field('id[' . $products_options_id . ']', $products_options_value_id, $selected_attribute, 'id="' . $inputFieldId . '" ' . $data_properties . $field_disabled) . '<label class="attribsRadioButton one" for="' . $inputFieldId . '">' . (!empty($products_options->fields['attributes_image']) ? zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image'], '', '', '') . ' ' : '') . $products_options_details . '</label><br>' . "\n";
break;
case '2':
$tmp_radio .= zen_draw_radio_field('id[' . $products_options_id . ']', $products_options_value_id, $selected_attribute, 'id="' . $inputFieldId . '" ' . $data_properties . $field_disabled) . '<label class="attribsRadioButton two" for="' . $inputFieldId . '">' . $products_options_details . (!empty($products_options->fields['attributes_image']) ? '<br>' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image'], '', '', '') : '') . '</label><br>' . "\n";

It appears these and the subsequent clauses are missing an underscore/should not have a space, to make the class name reflect the clause:

2023-12-24 13_02_43-zencart_includes_modules_attributes php at master · zencart_zencart

@drbyte
Copy link
Member

drbyte commented Dec 24, 2023

Interesting discovery.
Digging further, I see that it's been that way since at least v1.5.0.
And there's no CSS rule defined for it in any core CSS files.
Screen Shot 2023-12-24 at 1 01 09 PM

@drbyte
Copy link
Member

drbyte commented Dec 24, 2023

That said, I'm not sure it needs changing, since one can simply combine the two classes into one selector in a CSS file in order to target the combination.
ie:

.attribsRadioButton.one {
    font-weight: bold;
}

@torvista
Copy link
Member Author

Seems incorrect to have simple classes like "one" etc. that have no obvious relation to anything/no hint of function or use.

@lat9
Copy link
Contributor

lat9 commented Jan 23, 2024

Seems incorrect to have simple classes like "one" etc. that have no obvious relation to anything/no hint of function or use.

Seems, IMO, is the operative word! If this was newly-minted code, I would request that the class-name be more descriptive. Since those classes have been in-core for 12+ years, some site-specific CSS might be using those classes (as @drbyte) described above and I'll suggest keeping them.

Update: Perhaps a simple addition to the docs to identify what meaning those classes convey?

@lat9 lat9 added [Issue Type] Documentation Updates needed to the docs and removed [Issue Type] enhancement labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Issue Type] Documentation Updates needed to the docs
Projects
None yet
Development

No branches or pull requests

3 participants