Title: Postcode (billing) is not a valid postcode/ZIP.
Last modified: August 21, 2016

---

# Postcode (billing) is not a valid postcode/ZIP.

 *  Resolved [normski](https://wordpress.org/support/users/normski/)
 * (@normski)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/)
 * I have entered a valid UK postcode but get the message: “Postcode (billing) is
   not a valid postcode/ZIP.”
 * Any advice gratefully received.
 * Norman
 * [https://wordpress.org/plugins/jigoshop/](https://wordpress.org/plugins/jigoshop/)

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/page/2/?output_format=md)

 *  Thread Starter [normski](https://wordpress.org/support/users/normski/)
 * (@normski)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133226)
 * I notice that another user raised the same issue and it is marked as ‘resolved’.
   But I am still experiencing the problem withy UK postcodes.
 * Please advise
 * Norman
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133271)
 * I am also seeing this behaviour with UK post codes, both with a space in the 
   post code and not.
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133272)
 * Further to this I have checked, Jigoshop setting to validate post code is disabled
   but clearly javascript is still doing so.
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133273)
 * Normski, I believe I have found the issue.
 * jigoshop/classes/jigoshop_validation.class.php
 * There is a function as follows:
 *     ```
       /**
       	 * Checks for a valid postcode for a country
       	 *
       	 * @param   string  postcode
       	 * @param  string  country
       	 * @return  boolean
       	 */
       	public static function is_postcode($postcode, $country)
       	{
       		if (strlen(trim(preg_replace('/[\s\-A-Za-z0-9]/', '', $postcode))) > 0) {
       			return false;
       		}
   
       		$country = strtoupper(trim($country));
       		$postcode = strtoupper(trim($postcode));
   
       		if (!isset(self::$postcodes[$country])) {
       			return false;
       		}
   
       		if (Jigoshop_Base::get_options()->get_option('jigoshop_enable_postcode_validating') == 'yes') {
       			$regex = '/'.self::$postcodes[$country].'/';
       			jigoshop_log("VALIDATE POSTCODE: country = ".$country." & regex = ".$regex);
   
       			switch ($country) {
       				case 'GB':
       					return self::is_GB_postcode($postcode);
       				default:
       					$match = preg_match($regex, $postcode);
       					if ($match !== 1) {
       						return false;
       					}
       			}
       		}
   
       		return true;
       	}
       ```
   
 * Specifically the line
 * `case 'GB':`
 * Caused me to look further up, adjusting the line
 * `'UK' => '^(GIR|[A-Z]\d[A-Z\d]??|[A-Z]{2}\d[A-Z\d]??)[ ]??(\d[A-Z]{2})$',`
 * From UK to GB fixes the issue for me.
 * Jigoshop, strangely this only occurs on my live environment and not test.
 *  Thread Starter [normski](https://wordpress.org/support/users/normski/)
 * (@normski)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133274)
 * Many thanks Ragnar.
 * That works for me too.
 * I wonder if you can help with another matter. Is there a way of editing or changing
   the fields on the billing details/order form?
 * All hte best
 * Normski
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133277)
 * My suspicion is that there is an underlying issue with this though, my test site
   doesn’t need this fix on 1.10.5 whilst the live site does.
 * Jigoshop team – can you replicate?
 * I use the Checkout Fields Manager currently: [https://www.jigoshop.com/product/checkout-fields-manager/](https://www.jigoshop.com/product/checkout-fields-manager/)
 *  Plugin Author [Jigoshop Support – Paul](https://wordpress.org/support/users/paulpreston/)
 * (@paulpreston)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133278)
 * we are looking into it now…
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133279)
 * Thanks Paul much appreciated.
 *  [megawebmaster](https://wordpress.org/support/users/megawebmaster/)
 * (@megawebmaster)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133280)
 * Can I get the postcode you are having problems with? I tested it on a few things
   and moreover the code for validationg was not changed. The only thing is adding
   frontend validation in JavaScript (to speed up validation).
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133281)
 * I tried using PL9 7YB (pinched direct from Royal Mail website)
 * Please note that the javascript validation doesn’t appear to be the issue I’m
   facing but rather jigoshop_validation.class.php
 * I can send system info to [support@jigoshop.com](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/support@jigoshop.com?output_format=md)
   if that is of help?
 *  [megawebmaster](https://wordpress.org/support/users/megawebmaster/)
 * (@megawebmaster)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133284)
 * OK, the problem exists – will be fixed in 1.10.6
 *  [Ragnar Karlsson](https://wordpress.org/support/users/ragnarkarlsson/)
 * (@ragnarkarlsson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133285)
 * Great, thanks folks
 *  Thread Starter [normski](https://wordpress.org/support/users/normski/)
 * (@normski)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133287)
 * Thank you Ragnar and Amadeusz.
 *  [andytoop](https://wordpress.org/support/users/andytoop/)
 * (@andytoop)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133325)
 * Great that it will be fixed, but what about all the folks that can’t order on
   my shop at the moment? when will 1.10.6 be available?
 * where do I find: jigoshop/classes/jigoshop_validation.class.php as posted up 
   on Ragnar’s post
 * Andy
 *  [andytoop](https://wordpress.org/support/users/andytoop/)
 * (@andytoop)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/#post-5133326)
 * found it ta.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/page/2/?output_format=md)

The topic ‘Postcode (billing) is not a valid postcode/ZIP.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jigoshop_655549.svg)
 * [Jigoshop](https://wordpress.org/plugins/jigoshop/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jigoshop/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jigoshop/)
 * [Active Topics](https://wordpress.org/support/plugin/jigoshop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jigoshop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jigoshop/reviews/)

 * 19 replies
 * 7 participants
 * Last reply from: [thelandlord](https://wordpress.org/support/users/thelandlord/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/postcode-billing-is-not-a-valid-postcodezip/page/2/#post-5133438)
 * Status: resolved