lat9 / ZCA-Bootstrap-Template

A Bootstrap-4 template for Zen Cart versions 1.5.8 through 2.1.0. Forked from https://github.com/zcadditions/ZCA-Bootstrap-Template-for-1.5.6-v2.0.0c. See the demo site, below, for additional information.
https://zc158.vinosdefrutastropicales.com/zc158/index.php?main_page=index
GNU General Public License v3.0
4 stars 14 forks source link

Update tpl_shopping_cart_default.php #403

Closed retched closed 3 months ago

retched commented 4 months ago

Hides the Update Cell in the Shopping Cart unless the option SHOW_SHOPPING_CART_UPDATE is specifically set to Next to each Qty Box or Both Next to each Qty Box and Below all Products.

retched commented 4 months ago

Running the shopping card through an evaluation tool suggested that to comply with WCAG standard 1.3.1 a <TH> tag shouldn't be empty or contain images with no alt text.

So I hid the column that would contain the update button UNLESS it is explicitly set in the Admin dashboard. As well as change the last column, the total column, to a regular <TD> instead of a <TH>.

lat9 commented 4 months ago

Thanks for this. I'll review later this weekend. Why the change to td instead of th?

retched commented 4 months ago

It was a suggestion that 's shouldn't be empty, even with a non-breaking space, for accessibility. To quote the guideline I found:

https://webaim.org/techniques/tables/data#th Table headers should never be empty. This is particularly of concern for the top-left cell of some tables

I'm not sure how stringent that is though.

drbyte commented 4 months ago

One way we handle the "no empty header cell" elsewhere in Zen Cart is to simply give it a header of "Action". And often make that text aria-only.

retched commented 4 months ago

I didn't even consider that as a possibility. I can make a similar change in another commit.

retched commented 3 months ago

I reverted the empty cells to a <th> but gave each column an aria-label header with an empty cell. I also added two language definitions to lang.zca_bootstrap_common.php for this purpose.

retched commented 3 months ago

Should be done. Also went ahead and adjusted the quantity field to render the HTML aligned within the <td> itself too. image

Also caught a spelling error with the define name I used. Changed it to here as well.

retched commented 3 months ago

Squashed the three commits to make things easier to follow.

lat9 commented 3 months ago

Close enough. Please note that I'll be making a couple of slight formatting changes and adding the last-changed version to each module's lead-in comments.

Thanks for this!

lat9 commented 3 months ago

Tie this PR to the associated issue, #410.