attributes label screen reader issue
Posted: Fri Jun 26, 2026 7:45 pm
Hi
May have caught something in
tpl_pi_options_attributes_upd.php
which I now have an override copy in
templates/override/modules/pi/product_info
I was getting an error in Lighthouse in accessibility on pages that had attributes on them, the for label not being readable by off screen readers etc.
But in the end I think that it just was not formatted correctly,
its was showing as <label for>Easy Upgrade</label>
I think it should show as <label for="18">Easy Upgrade</label>
ie <label for="Easy Upgrade">Easy Upgrade</label>
on line 14 of tpl_pi_options_attributes_upd.php
I edited the line (original line now below it), I assume a typo using input_id instead of option id
I have done a few tests, and it seems to be ok now.
Would appreciate it if anyone could tell me I was wrong and it's going to cause another issue.
Regards
May have caught something in
tpl_pi_options_attributes_upd.php
which I now have an override copy in
templates/override/modules/pi/product_info
I was getting an error in Lighthouse in accessibility on pages that had attributes on them, the for label not being readable by off screen readers etc.
But in the end I think that it just was not formatted correctly,
its was showing as <label for>Easy Upgrade</label>
I think it should show as <label for="18">Easy Upgrade</label>
ie <label for="Easy Upgrade">Easy Upgrade</label>
on line 14 of tpl_pi_options_attributes_upd.php
I edited the line (original line now below it), I assume a typo using input_id instead of option id
Code: Select all
echo '<label for="' . $option['id'] . '">', $option['name'], '</label>';
// echo '<label for="', $input_id ?? NULL , '">', $option['name'], '</label>';Would appreciate it if anyone could tell me I was wrong and it's going to cause another issue.
Regards