Forums / Bug Reports / [Done v2.0] usps first class breaks validation on checkout

[Done v2.0] usps first class breaks validation on checkout

Locked

Views: 1,320

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
13 Nov 2009, 5:03 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

[Done v2.0] usps first class breaks validation on checkout

Running 1.38a+security+FEC, with usps shipping module enabled for priority and 'first class'. When I run validator.w3.org on the page, it reports the following (and other related) errors:

Line 276, Column 126: value of attribute "id" must be a single token

…="updateForm();" id="ship-usps-FIRST CLASS" />	  <label for="ship-usps-FIRST 

This attribute can not take a space-separated list of words as a value, but only one word ("token"). This may also be caused by the use of a space for the value of an attribute which does not permit it

I've looked via the Developer's ToolKit and 'first class' is a database entry for the usps module and it's the space between 'first' and 'class' that gets the validator's knickers in a bunch.

13 Nov 2009, 5:27 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: [Done v2.0] usps first class breaks validation on checkout

Your fix with FEC will be different than the following since it does its own thing for checkout.

In original Zen Cart v1.3.8a files, one would fix that by changing lines 99-100 of tpl_checkout_shipping_default.php as such:```

<?php echo zen_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked, 'id="ship-'.$quotes[$i]['id'] . '-' . [B]str_replace(' ', '-', [/B]$quotes[$i]['methods'][$j]['id'][B])[/B] .'"'); ?>

<label for="ship-<?php echo $quotes[$i]['id'] . '-' . [B]str_replace(' ', '-', [/B]$quotes[$i]['methods'][$j]['id'][B])[/B]; ?>" class="checkboxLabel" ><?php echo $quotes[$i]['methods'][$j]['title']; ?></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.

14 Nov 2009, 2:01 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: [Done v2.0] usps first class breaks validation on checkout

Thanks, DrByte, I thought it was going to be much more pervasive a change.