Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter writecraft

    (@writecraft)

    Been doing some fiddling around and think I’ve found a solution. Turns out your postal code validation required ‘Tax Downloads’ to be enabled, and then it removed the ability to select a country to ship to. So, in washington-state-sales-tax-for-shopp.php at line 54 after ‘//update hook’ I added :

    add_action( 'wp_enqueue_scripts', array( &$this, 'force_zip_tax_script' ) );

    Then modified zip-required.js as so:

    checkZip = function ($toCheckout) {
    		var $validZip = /^\d{5}(-\d{4})?$/;
    		var $shipZip = $('#shipping-postcode').val();
    		var $shipCountry =$('#shipping-country').val();
    
    		if ($shipCountry=='US') {
    				if (!$validZip.test($shipZip)) { ....

    This seems to work well for me — you might want to consider it for future updates.

    Thanks!

    Thread Starter writecraft

    (@writecraft)

    PS — you might want to allow country selection for downloads as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not validating zip code’ is closed to new replies.