Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 08-12-2009 05:40:28

nephiko
Member
Registered: 03-19-2009
Posts: 9

Shipping with UK Postcodes

Hi, i am looking for some help with setting up shipping costs to UK postcodes. I am no expert on code but if someone could give me an example of how it works, i am sure i could work from that.

An example would be, postcode HX =20, OX = 40.

Anyone able to point me in the right direction?

Thanks

Offline

 

#2 08-12-2009 12:56:47

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1650

Re: Shipping with UK Postcodes

Depends on  how in depth you want to go, but the script below will break down postcode areas plus the first two numerics as the majority of couriers have split postcode areas.

Code:

<?php 


// +--
// | All custom shipping scripts work in the same way.  A global
// | variable named 'ecom.customship' contains the following PHP
// | array.  Array keys with value info:
// |
// | weight     => Total weight of items being shipped.
// | total      => Subtotal of items being shipped.
// | quantity   => Quantity of items being shipped.
// | stateprov  => Ship to state/province.
// | country    => Ship to country.
// | postalcode => Ship to postal code.
// |
// | This script must set a global variable named 
// | 'ecom.customship_response' which is an array in the 
// | following format:
// |
// | method name => amount
// |
// | NOTE: Do not print anything within custom shipping
// | scripts.  They are designed only to return names and 
// | prices for custom shipping methods.
// |
// | This script is a User Defined Calculation script that
// | returns a static method and amount.
// +--
$info = $this->globals('ecom.customship');

$shipquantity = $info['quantity'];
$shippostcode = $info['postalcode'];
$ordertotal = $info['total'];

//Change to Uppercase
$shippostcode = strtoupper($shippostcode);

//remove white space
$postcode = preg_replace( '/[^a-z0-9]/i', '', $shippostcode );

// If length is acceptable, just remove the last three characters to make a 3 or 4 digit postcode
if ( in_array( strlen( $postcode ), array( 5, 6, 7 ) ) )
{$postcode = substr( $postcode, 0, -3 );}


//Deal with local postcode costs          
if (( preg_match( '/AL\d{1,2}/i', $postcode ))||( preg_match( '/EN\d{1,2}/i', $postcode ))||( preg_match( '/HP\d{1,2}/i', $postcode ))||( preg_match( '/LU\d{1,2}/i', $postcode ))||( preg_match( '/MK\d{1,2}/i', $postcode ))||( preg_match( '/SG\d{1,2}/i', $postcode ))||( preg_match( '/SG\d{1,2}/i', $postcode ))){$custom = array('UK Shipping' => '5.95','Collect from Bedford' => '2.00');}

//Deal with courier regions
elseif (( preg_match( '/B\d{1,2}/i', $postcode ))||( preg_match( '/BA\d{1,2}/i', $postcode ))||( preg_match( '/BB\d{1,2}/i', $postcode ))||( preg_match( '/BL\d{1,2}/i', $postcode ))||( preg_match( '/BN\d{1,2}/i', $postcode ))||( preg_match( '/BS\d{1,2}/i', $postcode ))||( preg_match( '/CB\d{1,2}/i', $postcode ))||( preg_match( '/CM\d{1,2}/i', $postcode ))||( preg_match( '/CO\d{1,2}/i', $postcode ))||( preg_match( '/CT\d{1,2}/i', $postcode ))||( preg_match( '/CV\d{1,2}/i', $postcode ))||( preg_match( '/DA\d{1,2}/i', $postcode ))||( preg_match( '/DE\d{1,2}/i', $postcode ))||( preg_match( '/DH\d{1,2}/i', $postcode ))||( preg_match( '/DL\d{1,2}/i', $postcode ))||( preg_match( '/DN\d{1,2}/i', $postcode ))||( preg_match( '/DY\d{1,2}/i', $postcode ))||( preg_match( '/EH\d{1,2}/i', $postcode ))||( preg_match( '/FY\d{1,2}/i', $postcode ))||( preg_match( '/G\d{1,2}/i', $postcode ))||( preg_match( '/GL\d{1,2}/i', $postcode ))||( preg_match( '/HD\d{1,2}/i', $postcode ))||( preg_match( '/HG\d{1,2}/i', $postcode ))||( preg_match( '/HR\d{1,2}/i', $postcode ))||( preg_match( '/HU\d{1,2}/i', $postcode ))||( preg_match( '/HX\d{1,2}/i', $postcode ))||( preg_match( '/L\d{1,2}/i', $postcode ))||( preg_match( '/LE\d{1,2}/i', $postcode ))||( preg_match( '/LS\d{1,2}/i', $postcode ))||( preg_match( '/M\d{1,2}/i', $postcode ))||( preg_match( '/ME\d{1,2}/i', $postcode ))||( preg_match( '/NE\d{1,2}/i', $postcode ))||( preg_match( '/NG\d{1,2}/i', $postcode ))||( preg_match( '/NN\d{1,2}/i', $postcode ))||( preg_match( '/OL\d{1,2}/i', $postcode ))||( preg_match( '/PR\d{1,2}/i', $postcode ))||( preg_match( '/RM\d{1,2}/i', $postcode ))||( preg_match( '/S\d{1,2}/i', $postcode ))||( preg_match( '/SN\d{1,2}/i', $postcode ))||( preg_match( '/SR\d{1,2}/i', $postcode ))||( preg_match( '/SS\d{1,2}/i', $postcode ))||( preg_match( '/TN\d{1,2}/i', $postcode ))||( preg_match( '/TS\d{1,2}/i', $postcode ))||( preg_match( '/WF\d{1,2}/i', $postcode ))||( preg_match( '/WN\d{1,2}/i', $postcode ))||( preg_match( '/WR\d{1,2}/i', $postcode ))||( preg_match( '/WS\d{1,2}/i', $postcode ))||( preg_match( '/WV\d{1,2}/i', $postcode ))||( preg_match( '/YO\d{1,2}/i', $postcode ))){$custom = array('UK Shipping' => '7.95','Collect from Bedford' => '2.00');}

//Deal with the courier regions with split postcode

elseif (($postcode==BD1)||($postcode==BD2)||($postcode==BD3)||($postcode==BD4)||($postcode==BD5)||($postcode==BD6)||($postcode==BD7)||($postcode==BD8)||($postcode==BD9)||($postcode==BD10)||($postcode==BD11)||($postcode==BD12)||($postcode==BD13)||($postcode==BD14)||($postcode==BD15)||($postcode==BD16)||($postcode==BD17)||($postcode==BD18)||($postcode==BD19)||($postcode==BD20)||($postcode==BD21)||($postcode==BD22)||($postcode==CM40)||($postcode==CM41)||($postcode==CM42)||($postcode==CM43)||($postcode==CM44)||($postcode==CM45)||($postcode==CM46)||($postcode==CM47)||($postcode==CM48)||($postcode==CM49)||($postcode==CM50)||($postcode==CM51)||($postcode==CM52)||($postcode==CM53)||($postcode==CM54)||($postcode==CM55)||($postcode==CM56)||($postcode==CM57)||($postcode==CM58)||($postcode==CM59)||($postcode==CM60)||($postcode==CM61)||($postcode==CM62)||($postcode==CM63)||($postcode==CM64)||($postcode==CM65)||($postcode==CM66)||($postcode==FK1)||($postcode==FK2)||($postcode==FK3)||($postcode==FK4)||($postcode==FK5)||($postcode==FK6)||($postcode==FK7)||($postcode==KA1)||($postcode==KA2)||($postcode==KA3)||($postcode==KA4)||($postcode==KA5)||($postcode==KA6)||($postcode==KA7)||($postcode==KA8)||($postcode==KA9)||($postcode==KA10)||($postcode==KA11)||($postcode==KA12)||($postcode==KA13)||($postcode==KA14)||($postcode==KA15)||($postcode==KA16)||($postcode==KA17)||($postcode==KA20)||($postcode==KA21)||($postcode==KA22)||($postcode==KA23)||($postcode==KA24)||($postcode==KA25)||($postcode==KA29)||($postcode==KA30)||($postcode==PA1)||($postcode==PA2)||($postcode==PA3)||($postcode==PA4)||($postcode==PA5)||($postcode==PA6)||($postcode==PA7)||($postcode==PA8)||($postcode==PA9)||($postcode==PA10)||($postcode==PA11)||($postcode==PA12)||($postcode==PA13)||($postcode==PA14)||($postcode==PA15)||($postcode==PA16)||($postcode==PA17)||($postcode==PA18)||($postcode==PA19)||($postcode==PE1)||($postcode==PE2)||($postcode==PE3)||($postcode==PE4)||($postcode==PE5)||($postcode==PE6)||($postcode==PE7)||($postcode==PE8)||($postcode==PE9)||($postcode==PE10)||($postcode==PE11)||($postcode==PE12)||($postcode==PE13)||($postcode==PE14)||($postcode==PE15)||($postcode==PE16)||($postcode==PE17)||($postcode==PE18)||($postcode==PE19)||($postcode==PE26)||($postcode==PE27)||($postcode==PE28)||($postcode==PE29)||($postcode==PO1)||($postcode==PO2)||($postcode==PO3)||($postcode==PO4)||($postcode==PO5)||($postcode==PO6)||($postcode==PO7)||($postcode==PO8)||($postcode==PO9)||($postcode==PO10)||($postcode==PO11)||($postcode==PO12)||($postcode==PO13)||($postcode==PO14)||($postcode==PO15)||($postcode==PO16)||($postcode==PO17)||($postcode==PO18)||($postcode==PO19)||($postcode==PO20)||($postcode==PO21)||($postcode==PO22)||($postcode==RH10)||($postcode==RH11)||($postcode==RH12)||($postcode==RH13)||($postcode==RH14)||($postcode==RH15)||($postcode==RH16)||($postcode==RH17)||($postcode==RH18)||($postcode==RH19)||($postcode==RH20)||($postcode==SK1)||($postcode==SK2)||($postcode==SK3)||($postcode==SK4)||($postcode==SK5)||($postcode==SK6)||($postcode==SK7)||($postcode==SK8)||($postcode==SK13)||($postcode==SK14)||($postcode==SK15)||($postcode==SK16)||($postcode==SK22)||($postcode==WA1)||($postcode==WA2)||($postcode==WA3)||($postcode==WA4)||($postcode==WA5)||($postcode==WA6)||($postcode==WA7)||($postcode==WA8)||($postcode==WA9)||($postcode==WA10)||($postcode==WA11)||($postcode==WA12)||($postcode==WA13)||($postcode==WA14)||($postcode==WA15)) {$custom = array('UK Shipping' => '7.95','Collect from Bedford' => '2.00');}

//Deal with scottish highlands & Belfast postcodes

elseif (($postcode==AB31)||($postcode==AB32)||($postcode==AB33)||($postcode==AB34)||($postcode==AB35)||($postcode==AB36)||($postcode==AB37)||($postcode==AB38)||($postcode==AB40)||($postcode==AB41)||($postcode==AB42)||($postcode==AB43)||($postcode==AB44)||($postcode==AB45)||($postcode==AB46)||($postcode==AB47)||($postcode==AB48)||($postcode==AB49)||($postcode==AB50)||($postcode==AB51)||($postcode==AB52)||($postcode==AB53)||($postcode==AB54)||($postcode==AB55)||($postcode==AB56)||($postcode==IV1)||($postcode==IV2)||($postcode==IV3)||($postcode==IV4)||($postcode==IV5)||($postcode==IV6)||($postcode==IV7)||($postcode==IV8)||($postcode==IV9)||($postcode==IV10)||($postcode==IV11)||($postcode==IV12)||($postcode==IV13)||($postcode==IV14)||($postcode==IV15)||($postcode==IV16)||($postcode==IV17)||($postcode==IV18)||($postcode==IV19)||($postcode==IV20)||($postcode==IV21)||($postcode==IV22)||($postcode==IV23)||($postcode==IV24)||($postcode==IV25)||($postcode==IV26)||($postcode==IV27)||($postcode==IV28)||($postcode==IV30)||($postcode==IV31)||($postcode==IV32)||($postcode==IV36)||($postcode==IV37)||($postcode==IV38)||($postcode==IV39)||($postcode==IV40)||($postcode==IV41)||($postcode==IV42)||($postcode==IV43)||($postcode==IV44)||($postcode==IV45)||($postcode==IV46)||($postcode==IV47)||($postcode==IV48)||($postcode==IV49)||($postcode==IV51)||($postcode==IV52)||($postcode==IV53)||($postcode==IV54)||($postcode==IV55)||($postcode==IV56)||($postcode==IV63)||($postcode==KA27)||($postcode==KA28)||($postcode==KW1)||($postcode==KW2)||($postcode==KW3)||($postcode==KW4)||($postcode==KW5)||($postcode==KW6)||($postcode==KW7)||($postcode==KW8)||($postcode==KW9)||($postcode==KW10)||($postcode==KW11)||($postcode==KW12)||($postcode==KW13)||($postcode==KW14)||($postcode==KW15)||($postcode==KW17)||($postcode==PA20)||($postcode==PA21)||($postcode==PA22)||($postcode==PA23)||($postcode==PA24)||($postcode==PA25)||($postcode==PA26)||($postcode==PA27)||($postcode==PA28)||($postcode==PA29)||($postcode==PA30)||($postcode==PA31)||($postcode==PA32)||($postcode==PA33)||($postcode==PA34)||($postcode==PA35)||($postcode==PA36)||($postcode==PA37)||($postcode==PA38)||($postcode==PA41)||($postcode==PA42)||($postcode==PA43)||($postcode==PA44)||($postcode==PA45)||($postcode==PA46)||($postcode==PA47)||($postcode==PA48)||($postcode==PA49)||($postcode==PA60)||($postcode==PA61)||($postcode==PA62)||($postcode==PA63)||($postcode==PA64)||($postcode==PA65)||($postcode==PA66)||($postcode==PA67)||($postcode==PA68)||($postcode==PA69)||($postcode==PA70)||($postcode==PA71)||($postcode==PA72)||($postcode==PA73)||($postcode==PA74)||($postcode==PA75)||($postcode==PA76)||($postcode==PA77)||($postcode==PA78)||($postcode==PH4)||($postcode==PH5)||($postcode==PH6)||($postcode==PH7)||($postcode==PH8)||($postcode==PH9)||($postcode==PH10)||($postcode==PH11)||($postcode==PH12)||($postcode==PH13)||($postcode==PH14)||($postcode==PH15)||($postcode==PH16)||($postcode==PH17)||($postcode==PH18)||($postcode==PH19)||($postcode==PH20)||($postcode==PH21)||($postcode==PH22)||($postcode==PH23)||($postcode==PH24)||($postcode==PH25)||($postcode==PH26)||($postcode==PH27)||($postcode==PH28)||($postcode==PH29)||($postcode==PH30)||($postcode==PH31)||($postcode==PH32)||($postcode==PH33)||($postcode==PH34)||($postcode==PH35)||($postcode==PH36)||($postcode==PH37)||($postcode==PH38)||($postcode==PH39)||($postcode==PH40)||($postcode==PH41)||($postcode==PH42)||($postcode==PH43)||($postcode==PH44)||($postcode==PH49)||($postcode==PH50)||($postcode==P030)||($postcode==P031)||($postcode==P032)||($postcode==P033)||($postcode==P034)||($postcode==P035)||($postcode==P036)||($postcode==P037)||($postcode==P038)||($postcode==P039)||($postcode==P040)||($postcode==P041)||( preg_match( '/BT\d{1,2}/i', $postcode ))||( preg_match( '/HS\d{1,2}/i', $postcode ))||( preg_match( '/ZE\d{1,2}/i', $postcode ))||( preg_match( '/IM\d{1,2}/i', $postcode ))||( preg_match( '/JE\d{1,2}/i', $postcode ))||( preg_match( '/GY\d{1,2}/i', $postcode )))
{$custom = array('Scottish Highlands, UK Isles & Northern Ireland(2-3 Days)' => '19.95');}

else{     $method  = 'UK Shipping';
     $total = '9.95';
     $custom = array($method => $total);}


$this->globals('ecom.customship_response',$custom);


?>

rob

Last edited by zanart (08-12-2009 13:00:52)


- Euorpacart 8

Offline

 

#3 08-13-2009 02:15:49

nephiko
Member
Registered: 03-19-2009
Posts: 9

Re: Shipping with UK Postcodes

Much appreciated. I shall have a good play with it today.

Thanks

Offline

 

#4 08-13-2009 05:11:48

nephiko
Member
Registered: 03-19-2009
Posts: 9

Re: Shipping with UK Postcodes

Works a treat, thanks again.

Offline

 

#5 08-13-2009 06:47:49

nephiko
Member
Registered: 03-19-2009
Posts: 9

Re: Shipping with UK Postcodes

Another question, if anyone is up for answering it, i need to put another option in before the postage. I use a set price for light items that go out in the post.

I assume that to do this i would need to add product weight values into each product, and then add an if command in before the postcode settings which sets the price as the standard if the item/s is below a certain amount. Would this assumption be correct, and if so, does anyone have a piece of code that would work?

Thanks

Offline

 

#6 08-13-2009 07:18:33

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1650

Re: Shipping with UK Postcodes

Have a play with this one. It includes IF statements depending on quantity and order value.

Code:

<?php 


// +--
// | All custom shipping scripts work in the same way.  A global
// | variable named 'ecom.customship' contains the following PHP
// | array.  Array keys with value info:
// |
// | weight     => Total weight of items being shipped.
// | total      => Subtotal of items being shipped.
// | quantity   => Quantity of items being shipped.
// | stateprov  => Ship to state/province.
// | country    => Ship to country.
// | postalcode => Ship to postal code.
// |
// | This script must set a global variable named 
// | 'ecom.customship_response' which is an array in the 
// | following format:
// |
// | method name => amount
// |
// | NOTE: Do not print anything within custom shipping
// | scripts.  They are designed only to return names and 
// | prices for custom shipping methods.
// |
// | This script is a User Defined Calculation script that
// | returns a static method and amount.
// +--
$info = $this->globals('ecom.customship');

$shipquantity = $info['quantity'];
$shippostcode = $info['postalcode'];
$ordertotal = $info['total'];

//Change to Uppercase
$shippostcode = strtoupper($shippostcode);

//remove white space
$postcode = preg_replace( '/[^a-z0-9]/i', '', $shippostcode );

// If length is acceptable, just remove the last three characters to make a 3 or 4 digit postcode
if ( in_array( strlen( $postcode ), array( 5, 6, 7 ) ) )
{$postcode = substr( $postcode, 0, -3 );}

//Deal with quantities under 3

if($shipquantity <= 3 && $ordertotal < 200){

//Deal with local postcode costs          
if (( preg_match( '/AL\d{1,2}/i', $postcode ))||( preg_match( '/EN\d{1,2}/i', $postcode ))||( preg_match( '/HP\d{1,2}/i', $postcode ))||( preg_match( '/LU\d{1,2}/i', $postcode ))||( preg_match( '/MK\d{1,2}/i', $postcode ))||( preg_match( '/SG\d{1,2}/i', $postcode ))||( preg_match( '/SG\d{1,2}/i', $postcode ))){$custom = array('UK Shipping' => '5.95','Collect from Bedford' => '2.00');}

//Deal with courier regions
elseif (( preg_match( '/B\d{1,2}/i', $postcode ))||( preg_match( '/BA\d{1,2}/i', $postcode ))||( preg_match( '/BB\d{1,2}/i', $postcode ))||( preg_match( '/BL\d{1,2}/i', $postcode ))||( preg_match( '/BN\d{1,2}/i', $postcode ))||( preg_match( '/BS\d{1,2}/i', $postcode ))||( preg_match( '/CB\d{1,2}/i', $postcode ))||( preg_match( '/CM\d{1,2}/i', $postcode ))||( preg_match( '/CO\d{1,2}/i', $postcode ))||( preg_match( '/CT\d{1,2}/i', $postcode ))||( preg_match( '/CV\d{1,2}/i', $postcode ))||( preg_match( '/DA\d{1,2}/i', $postcode ))||( preg_match( '/DE\d{1,2}/i', $postcode ))||( preg_match( '/DH\d{1,2}/i', $postcode ))||( preg_match( '/DL\d{1,2}/i', $postcode ))||( preg_match( '/DN\d{1,2}/i', $postcode ))||( preg_match( '/DY\d{1,2}/i', $postcode ))||( preg_match( '/EH\d{1,2}/i', $postcode ))||( preg_match( '/FY\d{1,2}/i', $postcode ))||( preg_match( '/G\d{1,2}/i', $postcode ))||( preg_match( '/GL\d{1,2}/i', $postcode ))||( preg_match( '/HD\d{1,2}/i', $postcode ))||( preg_match( '/HG\d{1,2}/i', $postcode ))||( preg_match( '/HR\d{1,2}/i', $postcode ))||( preg_match( '/HU\d{1,2}/i', $postcode ))||( preg_match( '/HX\d{1,2}/i', $postcode ))||( preg_match( '/L\d{1,2}/i', $postcode ))||( preg_match( '/LE\d{1,2}/i', $postcode ))||( preg_match( '/LS\d{1,2}/i', $postcode ))||( preg_match( '/M\d{1,2}/i', $postcode ))||( preg_match( '/ME\d{1,2}/i', $postcode ))||( preg_match( '/NE\d{1,2}/i', $postcode ))||( preg_match( '/NG\d{1,2}/i', $postcode ))||( preg_match( '/NN\d{1,2}/i', $postcode ))||( preg_match( '/OL\d{1,2}/i', $postcode ))||( preg_match( '/PR\d{1,2}/i', $postcode ))||( preg_match( '/RM\d{1,2}/i', $postcode ))||( preg_match( '/S\d{1,2}/i', $postcode ))||( preg_match( '/SN\d{1,2}/i', $postcode ))||( preg_match( '/SR\d{1,2}/i', $postcode ))||( preg_match( '/SS\d{1,2}/i', $postcode ))||( preg_match( '/TN\d{1,2}/i', $postcode ))||( preg_match( '/TS\d{1,2}/i', $postcode ))||( preg_match( '/WF\d{1,2}/i', $postcode ))||( preg_match( '/WN\d{1,2}/i', $postcode ))||( preg_match( '/WR\d{1,2}/i', $postcode ))||( preg_match( '/WS\d{1,2}/i', $postcode ))||( preg_match( '/WV\d{1,2}/i', $postcode ))||( preg_match( '/YO\d{1,2}/i', $postcode ))){$custom = array('UK Shipping' => '7.95','Collect from Bedford' => '2.00');}

//Deal with the courier regions with split postcode

elseif (($postcode==BD1)||($postcode==BD2)||($postcode==BD3)||($postcode==BD4)||($postcode==BD5)||($postcode==BD6)||($postcode==BD7)||($postcode==BD8)||($postcode==BD9)||($postcode==BD10)||($postcode==BD11)||($postcode==BD12)||($postcode==BD13)||($postcode==BD14)||($postcode==BD15)||($postcode==BD16)||($postcode==BD17)||($postcode==BD18)||($postcode==BD19)||($postcode==BD20)||($postcode==BD21)||($postcode==BD22)||($postcode==CM40)||($postcode==CM41)||($postcode==CM42)||($postcode==CM43)||($postcode==CM44)||($postcode==CM45)||($postcode==CM46)||($postcode==CM47)||($postcode==CM48)||($postcode==CM49)||($postcode==CM50)||($postcode==CM51)||($postcode==CM52)||($postcode==CM53)||($postcode==CM54)||($postcode==CM55)||($postcode==CM56)||($postcode==CM57)||($postcode==CM58)||($postcode==CM59)||($postcode==CM60)||($postcode==CM61)||($postcode==CM62)||($postcode==CM63)||($postcode==CM64)||($postcode==CM65)||($postcode==CM66)||($postcode==FK1)||($postcode==FK2)||($postcode==FK3)||($postcode==FK4)||($postcode==FK5)||($postcode==FK6)||($postcode==FK7)||($postcode==KA1)||($postcode==KA2)||($postcode==KA3)||($postcode==KA4)||($postcode==KA5)||($postcode==KA6)||($postcode==KA7)||($postcode==KA8)||($postcode==KA9)||($postcode==KA10)||($postcode==KA11)||($postcode==KA12)||($postcode==KA13)||($postcode==KA14)||($postcode==KA15)||($postcode==KA16)||($postcode==KA17)||($postcode==KA20)||($postcode==KA21)||($postcode==KA22)||($postcode==KA23)||($postcode==KA24)||($postcode==KA25)||($postcode==KA29)||($postcode==KA30)||($postcode==PA1)||($postcode==PA2)||($postcode==PA3)||($postcode==PA4)||($postcode==PA5)||($postcode==PA6)||($postcode==PA7)||($postcode==PA8)||($postcode==PA9)||($postcode==PA10)||($postcode==PA11)||($postcode==PA12)||($postcode==PA13)||($postcode==PA14)||($postcode==PA15)||($postcode==PA16)||($postcode==PA17)||($postcode==PA18)||($postcode==PA19)||($postcode==PE1)||($postcode==PE2)||($postcode==PE3)||($postcode==PE4)||($postcode==PE5)||($postcode==PE6)||($postcode==PE7)||($postcode==PE8)||($postcode==PE9)||($postcode==PE10)||($postcode==PE11)||($postcode==PE12)||($postcode==PE13)||($postcode==PE14)||($postcode==PE15)||($postcode==PE16)||($postcode==PE17)||($postcode==PE18)||($postcode==PE19)||($postcode==PE26)||($postcode==PE27)||($postcode==PE28)||($postcode==PE29)||($postcode==PO1)||($postcode==PO2)||($postcode==PO3)||($postcode==PO4)||($postcode==PO5)||($postcode==PO6)||($postcode==PO7)||($postcode==PO8)||($postcode==PO9)||($postcode==PO10)||($postcode==PO11)||($postcode==PO12)||($postcode==PO13)||($postcode==PO14)||($postcode==PO15)||($postcode==PO16)||($postcode==PO17)||($postcode==PO18)||($postcode==PO19)||($postcode==PO20)||($postcode==PO21)||($postcode==PO22)||($postcode==RH10)||($postcode==RH11)||($postcode==RH12)||($postcode==RH13)||($postcode==RH14)||($postcode==RH15)||($postcode==RH16)||($postcode==RH17)||($postcode==RH18)||($postcode==RH19)||($postcode==RH20)||($postcode==SK1)||($postcode==SK2)||($postcode==SK3)||($postcode==SK4)||($postcode==SK5)||($postcode==SK6)||($postcode==SK7)||($postcode==SK8)||($postcode==SK13)||($postcode==SK14)||($postcode==SK15)||($postcode==SK16)||($postcode==SK22)||($postcode==WA1)||($postcode==WA2)||($postcode==WA3)||($postcode==WA4)||($postcode==WA5)||($postcode==WA6)||($postcode==WA7)||($postcode==WA8)||($postcode==WA9)||($postcode==WA10)||($postcode==WA11)||($postcode==WA12)||($postcode==WA13)||($postcode==WA14)||($postcode==WA15)) {$custom = array('UK Shipping' => '7.95','Collect from Bedford' => '2.00');}

//Deal with scottish highlands & Belfast postcodes

elseif (($postcode==AB31)||($postcode==AB32)||($postcode==AB33)||($postcode==AB34)||($postcode==AB35)||($postcode==AB36)||($postcode==AB37)||($postcode==AB38)||($postcode==AB40)||($postcode==AB41)||($postcode==AB42)||($postcode==AB43)||($postcode==AB44)||($postcode==AB45)||($postcode==AB46)||($postcode==AB47)||($postcode==AB48)||($postcode==AB49)||($postcode==AB50)||($postcode==AB51)||($postcode==AB52)||($postcode==AB53)||($postcode==AB54)||($postcode==AB55)||($postcode==AB56)||($postcode==IV1)||($postcode==IV2)||($postcode==IV3)||($postcode==IV4)||($postcode==IV5)||($postcode==IV6)||($postcode==IV7)||($postcode==IV8)||($postcode==IV9)||($postcode==IV10)||($postcode==IV11)||($postcode==IV12)||($postcode==IV13)||($postcode==IV14)||($postcode==IV15)||($postcode==IV16)||($postcode==IV17)||($postcode==IV18)||($postcode==IV19)||($postcode==IV20)||($postcode==IV21)||($postcode==IV22)||($postcode==IV23)||($postcode==IV24)||($postcode==IV25)||($postcode==IV26)||($postcode==IV27)||($postcode==IV28)||($postcode==IV30)||($postcode==IV31)||($postcode==IV32)||($postcode==IV36)||($postcode==IV37)||($postcode==IV38)||($postcode==IV39)||($postcode==IV40)||($postcode==IV41)||($postcode==IV42)||($postcode==IV43)||($postcode==IV44)||($postcode==IV45)||($postcode==IV46)||($postcode==IV47)||($postcode==IV48)||($postcode==IV49)||($postcode==IV51)||($postcode==IV52)||($postcode==IV53)||($postcode==IV54)||($postcode==IV55)||($postcode==IV56)||($postcode==IV63)||($postcode==KA27)||($postcode==KA28)||($postcode==KW1)||($postcode==KW2)||($postcode==KW3)||($postcode==KW4)||($postcode==KW5)||($postcode==KW6)||($postcode==KW7)||($postcode==KW8)||($postcode==KW9)||($postcode==KW10)||($postcode==KW11)||($postcode==KW12)||($postcode==KW13)||($postcode==KW14)||($postcode==KW15)||($postcode==KW17)||($postcode==PA20)||($postcode==PA21)||($postcode==PA22)||($postcode==PA23)||($postcode==PA24)||($postcode==PA25)||($postcode==PA26)||($postcode==PA27)||($postcode==PA28)||($postcode==PA29)||($postcode==PA30)||($postcode==PA31)||($postcode==PA32)||($postcode==PA33)||($postcode==PA34)||($postcode==PA35)||($postcode==PA36)||($postcode==PA37)||($postcode==PA38)||($postcode==PA41)||($postcode==PA42)||($postcode==PA43)||($postcode==PA44)||($postcode==PA45)||($postcode==PA46)||($postcode==PA47)||($postcode==PA48)||($postcode==PA49)||($postcode==PA60)||($postcode==PA61)||($postcode==PA62)||($postcode==PA63)||($postcode==PA64)||($postcode==PA65)||($postcode==PA66)||($postcode==PA67)||($postcode==PA68)||($postcode==PA69)||($postcode==PA70)||($postcode==PA71)||($postcode==PA72)||($postcode==PA73)||($postcode==PA74)||($postcode==PA75)||($postcode==PA76)||($postcode==PA77)||($postcode==PA78)||($postcode==PH4)||($postcode==PH5)||($postcode==PH6)||($postcode==PH7)||($postcode==PH8)||($postcode==PH9)||($postcode==PH10)||($postcode==PH11)||($postcode==PH12)||($postcode==PH13)||($postcode==PH14)||($postcode==PH15)||($postcode==PH16)||($postcode==PH17)||($postcode==PH18)||($postcode==PH19)||($postcode==PH20)||($postcode==PH21)||($postcode==PH22)||($postcode==PH23)||($postcode==PH24)||($postcode==PH25)||($postcode==PH26)||($postcode==PH27)||($postcode==PH28)||($postcode==PH29)||($postcode==PH30)||($postcode==PH31)||($postcode==PH32)||($postcode==PH33)||($postcode==PH34)||($postcode==PH35)||($postcode==PH36)||($postcode==PH37)||($postcode==PH38)||($postcode==PH39)||($postcode==PH40)||($postcode==PH41)||($postcode==PH42)||($postcode==PH43)||($postcode==PH44)||($postcode==PH49)||($postcode==PH50)||($postcode==P030)||($postcode==P031)||($postcode==P032)||($postcode==P033)||($postcode==P034)||($postcode==P035)||($postcode==P036)||($postcode==P037)||($postcode==P038)||($postcode==P039)||($postcode==P040)||($postcode==P041)||( preg_match( '/BT\d{1,2}/i', $postcode ))||( preg_match( '/HS\d{1,2}/i', $postcode ))||( preg_match( '/ZE\d{1,2}/i', $postcode ))||( preg_match( '/IM\d{1,2}/i', $postcode ))||( preg_match( '/JE\d{1,2}/i', $postcode ))||( preg_match( '/GY\d{1,2}/i', $postcode )))
{$custom = array('Scottish Highlands, UK Isles & Northern Ireland(2-3 Days)' => '19.95');}



else{     $method  = 'UK Shipping';
     $total = '9.95';
     $custom = array($method => $total);}     

}

//Deal with quantities OVER 3
elseif($shipquantity > 3 && $ordertotal < 200){


//Deal with local postcode costs          
if (( preg_match( '/AL\d{1,2}/i', $postcode ))||( preg_match( '/EN\d{1,2}/i', $postcode ))||( preg_match( '/HP\d{1,2}/i', $postcode ))||( preg_match( '/LU\d{1,2}/i', $postcode ))||( preg_match( '/MK\d{1,2}/i', $postcode ))||( preg_match( '/SG\d{1,2}/i', $postcode ))||( preg_match( '/SG\d{1,2}/i', $postcode ))){$custom = array('UK Shipping' => '7.95','Collect from Bedford' => '2.00');}

//Deal with courier regions
elseif (( preg_match( '/B\d{1,2}/i', $postcode ))||( preg_match( '/BA\d{1,2}/i', $postcode ))||( preg_match( '/BB\d{1,2}/i', $postcode ))||( preg_match( '/BL\d{1,2}/i', $postcode ))||( preg_match( '/BN\d{1,2}/i', $postcode ))||( preg_match( '/BS\d{1,2}/i', $postcode ))||( preg_match( '/CB\d{1,2}/i', $postcode ))||( preg_match( '/CM\d{1,2}/i', $postcode ))||( preg_match( '/CO\d{1,2}/i', $postcode ))||( preg_match( '/CT\d{1,2}/i', $postcode ))||( preg_match( '/CV\d{1,2}/i', $postcode ))||( preg_match( '/DA\d{1,2}/i', $postcode ))||( preg_match( '/DE\d{1,2}/i', $postcode ))||( preg_match( '/DH\d{1,2}/i', $postcode ))||( preg_match( '/DL\d{1,2}/i', $postcode ))||( preg_match( '/DN\d{1,2}/i', $postcode ))||( preg_match( '/DY\d{1,2}/i', $postcode ))||( preg_match( '/EH\d{1,2}/i', $postcode ))||( preg_match( '/FY\d{1,2}/i', $postcode ))||( preg_match( '/G\d{1,2}/i', $postcode ))||( preg_match( '/GL\d{1,2}/i', $postcode ))||( preg_match( '/HD\d{1,2}/i', $postcode ))||( preg_match( '/HG\d{1,2}/i', $postcode ))||( preg_match( '/HR\d{1,2}/i', $postcode ))||( preg_match( '/HU\d{1,2}/i', $postcode ))||( preg_match( '/HX\d{1,2}/i', $postcode ))||( preg_match( '/L\d{1,2}/i', $postcode ))||( preg_match( '/LE\d{1,2}/i', $postcode ))||( preg_match( '/LS\d{1,2}/i', $postcode ))||( preg_match( '/M\d{1,2}/i', $postcode ))||( preg_match( '/ME\d{1,2}/i', $postcode ))||( preg_match( '/NE\d{1,2}/i', $postcode ))||( preg_match( '/NG\d{1,2}/i', $postcode ))||( preg_match( '/NN\d{1,2}/i', $postcode ))||( preg_match( '/OL\d{1,2}/i', $postcode ))||( preg_match( '/PR\d{1,2}/i', $postcode ))||( preg_match( '/RM\d{1,2}/i', $postcode ))||( preg_match( '/S\d{1,2}/i', $postcode ))||( preg_match( '/SN\d{1,2}/i', $postcode ))||( preg_match( '/SR\d{1,2}/i', $postcode ))||( preg_match( '/SS\d{1,2}/i', $postcode ))||( preg_match( '/TN\d{1,2}/i', $postcode ))||( preg_match( '/TS\d{1,2}/i', $postcode ))||( preg_match( '/WF\d{1,2}/i', $postcode ))||( preg_match( '/WN\d{1,2}/i', $postcode ))||( preg_match( '/WR\d{1,2}/i', $postcode ))||( preg_match( '/WS\d{1,2}/i', $postcode ))||( preg_match( '/WV\d{1,2}/i', $postcode ))||( preg_match( '/YO\d{1,2}/i', $postcode ))){$custom = array('UK Shipping' => '9.95','Collect from Bedford' => '2.00');}


//Deal with the courier regions with split postcode

elseif (($postcode==BD1)||($postcode==BD2)||($postcode==BD3)||($postcode==BD4)||($postcode==BD5)||($postcode==BD6)||($postcode==BD7)||($postcode==BD8)||($postcode==BD9)||($postcode==BD10)||($postcode==BD11)||($postcode==BD12)||($postcode==BD13)||($postcode==BD14)||($postcode==BD15)||($postcode==BD16)||($postcode==BD17)||($postcode==BD18)||($postcode==BD19)||($postcode==BD20)||($postcode==BD21)||($postcode==BD22)||($postcode==CM40)||($postcode==CM41)||($postcode==CM42)||($postcode==CM43)||($postcode==CM44)||($postcode==CM45)||($postcode==CM46)||($postcode==CM47)||($postcode==CM48)||($postcode==CM49)||($postcode==CM50)||($postcode==CM51)||($postcode==CM52)||($postcode==CM53)||($postcode==CM54)||($postcode==CM55)||($postcode==CM56)||($postcode==CM57)||($postcode==CM58)||($postcode==CM59)||($postcode==CM60)||($postcode==CM61)||($postcode==CM62)||($postcode==CM63)||($postcode==CM64)||($postcode==CM65)||($postcode==CM66)||($postcode==FK1)||($postcode==FK2)||($postcode==FK3)||($postcode==FK4)||($postcode==FK5)||($postcode==FK6)||($postcode==FK7)||($postcode==KA1)||($postcode==KA2)||($postcode==KA3)||($postcode==KA4)||($postcode==KA5)||($postcode==KA6)||($postcode==KA7)||($postcode==KA8)||($postcode==KA9)||($postcode==KA10)||($postcode==KA11)||($postcode==KA12)||($postcode==KA13)||($postcode==KA14)||($postcode==KA15)||($postcode==KA16)||($postcode==KA17)||($postcode==KA20)||($postcode==KA21)||($postcode==KA22)||($postcode==KA23)||($postcode==KA24)||($postcode==KA25)||($postcode==KA29)||($postcode==KA30)||($postcode==PA1)||($postcode==PA2)||($postcode==PA3)||($postcode==PA4)||($postcode==PA5)||($postcode==PA6)||($postcode==PA7)||($postcode==PA8)||($postcode==PA9)||($postcode==PA10)||($postcode==PA11)||($postcode==PA12)||($postcode==PA13)||($postcode==PA14)||($postcode==PA15)||($postcode==PA16)||($postcode==PA17)||($postcode==PA18)||($postcode==PA19)||($postcode==PE1)||($postcode==PE2)||($postcode==PE3)||($postcode==PE4)||($postcode==PE5)||($postcode==PE6)||($postcode==PE7)||($postcode==PE8)||($postcode==PE9)||($postcode==PE10)||($postcode==PE11)||($postcode==PE12)||($postcode==PE13)||($postcode==PE14)||($postcode==PE15)||($postcode==PE16)||($postcode==PE17)||($postcode==PE18)||($postcode==PE19)||($postcode==PE26)||($postcode==PE27)||($postcode==PE28)||($postcode==PE29)||($postcode==PO1)||($postcode==PO2)||($postcode==PO3)||($postcode==PO4)||($postcode==PO5)||($postcode==PO6)||($postcode==PO7)||($postcode==PO8)||($postcode==PO9)||($postcode==PO10)||($postcode==PO11)||($postcode==PO12)||($postcode==PO13)||($postcode==PO14)||($postcode==PO15)||($postcode==PO16)||($postcode==PO17)||($postcode==PO18)||($postcode==PO19)||($postcode==PO20)||($postcode==PO21)||($postcode==PO22)||($postcode==RH10)||($postcode==RH11)||($postcode==RH12)||($postcode==RH13)||($postcode==RH14)||($postcode==RH15)||($postcode==RH16)||($postcode==RH17)||($postcode==RH18)||($postcode==RH19)||($postcode==RH20)||($postcode==SK1)||($postcode==SK2)||($postcode==SK3)||($postcode==SK4)||($postcode==SK5)||($postcode==SK6)||($postcode==SK7)||($postcode==SK8)||($postcode==SK13)||($postcode==SK14)||($postcode==SK15)||($postcode==SK16)||($postcode==SK22)||($postcode==WA1)||($postcode==WA2)||($postcode==WA3)||($postcode==WA4)||($postcode==WA5)||($postcode==WA6)||($postcode==WA7)||($postcode==WA8)||($postcode==WA9)||($postcode==WA10)||($postcode==WA11)||($postcode==WA12)||($postcode==WA13)||($postcode==WA14)||($postcode==WA15)) {$custom = array('UK Shipping' => '9.95','Collect from Bedford' => '2.00');}



//Deal with scottish highlands & Belfast postcodes

elseif (($postcode==AB31)||($postcode==AB32)||($postcode==AB33)||($postcode==AB34)||($postcode==AB35)||($postcode==AB36)||($postcode==AB37)||($postcode==AB38)||($postcode==AB40)||($postcode==AB41)||($postcode==AB42)||($postcode==AB43)||($postcode==AB44)||($postcode==AB45)||($postcode==AB46)||($postcode==AB47)||($postcode==AB48)||($postcode==AB49)||($postcode==AB50)||($postcode==AB51)||($postcode==AB52)||($postcode==AB53)||($postcode==AB54)||($postcode==AB55)||($postcode==AB56)||($postcode==IV1)||($postcode==IV2)||($postcode==IV3)||($postcode==IV4)||($postcode==IV5)||($postcode==IV6)||($postcode==IV7)||($postcode==IV8)||($postcode==IV9)||($postcode==IV10)||($postcode==IV11)||($postcode==IV12)||($postcode==IV13)||($postcode==IV14)||($postcode==IV15)||($postcode==IV16)||($postcode==IV17)||($postcode==IV18)||($postcode==IV19)||($postcode==IV20)||($postcode==IV21)||($postcode==IV22)||($postcode==IV23)||($postcode==IV24)||($postcode==IV25)||($postcode==IV26)||($postcode==IV27)||($postcode==IV28)||($postcode==IV30)||($postcode==IV31)||($postcode==IV32)||($postcode==IV36)||($postcode==IV37)||($postcode==IV38)||($postcode==IV39)||($postcode==IV40)||($postcode==IV41)||($postcode==IV42)||($postcode==IV43)||($postcode==IV44)||($postcode==IV45)||($postcode==IV46)||($postcode==IV47)||($postcode==IV48)||($postcode==IV49)||($postcode==IV51)||($postcode==IV52)||($postcode==IV53)||($postcode==IV54)||($postcode==IV55)||($postcode==IV56)||($postcode==IV63)||($postcode==KA27)||($postcode==KA28)||($postcode==KW1)||($postcode==KW2)||($postcode==KW3)||($postcode==KW4)||($postcode==KW5)||($postcode==KW6)||($postcode==KW7)||($postcode==KW8)||($postcode==KW9)||($postcode==KW10)||($postcode==KW11)||($postcode==KW12)||($postcode==KW13)||($postcode==KW14)||($postcode==KW15)||($postcode==KW17)||($postcode==PA20)||($postcode==PA21)||($postcode==PA22)||($postcode==PA23)||($postcode==PA24)||($postcode==PA25)||($postcode==PA26)||($postcode==PA27)||($postcode==PA28)||($postcode==PA29)||($postcode==PA30)||($postcode==PA31)||($postcode==PA32)||($postcode==PA33)||($postcode==PA34)||($postcode==PA35)||($postcode==PA36)||($postcode==PA37)||($postcode==PA38)||($postcode==PA41)||($postcode==PA42)||($postcode==PA43)||($postcode==PA44)||($postcode==PA45)||($postcode==PA46)||($postcode==PA47)||($postcode==PA48)||($postcode==PA49)||($postcode==PA60)||($postcode==PA61)||($postcode==PA62)||($postcode==PA63)||($postcode==PA64)||($postcode==PA65)||($postcode==PA66)||($postcode==PA67)||($postcode==PA68)||($postcode==PA69)||($postcode==PA70)||($postcode==PA71)||($postcode==PA72)||($postcode==PA73)||($postcode==PA74)||($postcode==PA75)||($postcode==PA76)||($postcode==PA77)||($postcode==PA78)||($postcode==PH4)||($postcode==PH5)||($postcode==PH6)||($postcode==PH7)||($postcode==PH8)||($postcode==PH9)||($postcode==PH10)||($postcode==PH11)||($postcode==PH12)||($postcode==PH13)||($postcode==PH14)||($postcode==PH15)||($postcode==PH16)||($postcode==PH17)||($postcode==PH18)||($postcode==PH19)||($postcode==PH20)||($postcode==PH21)||($postcode==PH22)||($postcode==PH23)||($postcode==PH24)||($postcode==PH25)||($postcode==PH26)||($postcode==PH27)||($postcode==PH28)||($postcode==PH29)||($postcode==PH30)||($postcode==PH31)||($postcode==PH32)||($postcode==PH33)||($postcode==PH34)||($postcode==PH35)||($postcode==PH36)||($postcode==PH37)||($postcode==PH38)||($postcode==PH39)||($postcode==PH40)||($postcode==PH41)||($postcode==PH42)||($postcode==PH43)||($postcode==PH44)||($postcode==PH49)||($postcode==PH50)||($postcode==P030)||($postcode==P031)||($postcode==P032)||($postcode==P033)||($postcode==P034)||($postcode==P035)||($postcode==P036)||($postcode==P037)||($postcode==P038)||($postcode==P039)||($postcode==P040)||($postcode==P041)||( preg_match( '/BT\d{1,2}/i', $postcode ))||( preg_match( '/HS\d{1,2}/i', $postcode ))||( preg_match( '/ZE\d{1,2}/i', $postcode ))||( preg_match( '/IM\d{1,2}/i', $postcode ))||( preg_match( '/JE\d{1,2}/i', $postcode ))||( preg_match( '/GY\d{1,2}/i', $postcode )))
{$custom = array('Scottish Highlands, UK Isles & Northern Ireland(2-3 Days)' => '34.95');}


else{     $method  = 'UK Shipping';
     $total = '10.95';
     $custom = array($method => $total);}     

}
      
elseif ($ordertotal > 200) {

if 
(($postcode==AB31)||($postcode==AB32)||($postcode==AB33)||($postcode==AB34)||($postcode==AB35)||($postcode==AB36)||($postcode==AB37)||($postcode==AB38)||($postcode==AB40)||($postcode==AB41)||($postcode==AB42)||($postcode==AB43)||($postcode==AB44)||($postcode==AB45)||($postcode==AB46)||($postcode==AB47)||($postcode==AB48)||($postcode==AB49)||($postcode==AB50)||($postcode==AB51)||($postcode==AB52)||($postcode==AB53)||($postcode==AB54)||($postcode==AB55)||($postcode==AB56)||($postcode==IV1)||($postcode==IV2)||($postcode==IV3)||($postcode==IV4)||($postcode==IV5)||($postcode==IV6)||($postcode==IV7)||($postcode==IV8)||($postcode==IV9)||($postcode==IV10)||($postcode==IV11)||($postcode==IV12)||($postcode==IV13)||($postcode==IV14)||($postcode==IV15)||($postcode==IV16)||($postcode==IV17)||($postcode==IV18)||($postcode==IV19)||($postcode==IV20)||($postcode==IV21)||($postcode==IV22)||($postcode==IV23)||($postcode==IV24)||($postcode==IV25)||($postcode==IV26)||($postcode==IV27)||($postcode==IV28)||($postcode==IV30)||($postcode==IV31)||($postcode==IV32)||($postcode==IV36)||($postcode==IV37)||($postcode==IV38)||($postcode==IV39)||($postcode==IV40)||($postcode==IV41)||($postcode==IV42)||($postcode==IV43)||($postcode==IV44)||($postcode==IV45)||($postcode==IV46)||($postcode==IV47)||($postcode==IV48)||($postcode==IV49)||($postcode==IV51)||($postcode==IV52)||($postcode==IV53)||($postcode==IV54)||($postcode==IV55)||($postcode==IV56)||($postcode==IV63)||($postcode==KA27)||($postcode==KA28)||($postcode==KW1)||($postcode==KW2)||($postcode==KW3)||($postcode==KW4)||($postcode==KW5)||($postcode==KW6)||($postcode==KW7)||($postcode==KW8)||($postcode==KW9)||($postcode==KW10)||($postcode==KW11)||($postcode==KW12)||($postcode==KW13)||($postcode==KW14)||($postcode==KW15)||($postcode==KW17)||($postcode==PA20)||($postcode==PA21)||($postcode==PA22)||($postcode==PA23)||($postcode==PA24)||($postcode==PA25)||($postcode==PA26)||($postcode==PA27)||($postcode==PA28)||($postcode==PA29)||($postcode==PA30)||($postcode==PA31)||($postcode==PA32)||($postcode==PA33)||($postcode==PA34)||($postcode==PA35)||($postcode==PA36)||($postcode==PA37)||($postcode==PA38)||($postcode==PA41)||($postcode==PA42)||($postcode==PA43)||($postcode==PA44)||($postcode==PA45)||($postcode==PA46)||($postcode==PA47)||($postcode==PA48)||($postcode==PA49)||($postcode==PA60)||($postcode==PA61)||($postcode==PA62)||($postcode==PA63)||($postcode==PA64)||($postcode==PA65)||($postcode==PA66)||($postcode==PA67)||($postcode==PA68)||($postcode==PA69)||($postcode==PA70)||($postcode==PA71)||($postcode==PA72)||($postcode==PA73)||($postcode==PA74)||($postcode==PA75)||($postcode==PA76)||($postcode==PA77)||($postcode==PA78)||($postcode==PH4)||($postcode==PH5)||($postcode==PH6)||($postcode==PH7)||($postcode==PH8)||($postcode==PH9)||($postcode==PH10)||($postcode==PH11)||($postcode==PH12)||($postcode==PH13)||($postcode==PH14)||($postcode==PH15)||($postcode==PH16)||($postcode==PH17)||($postcode==PH18)||($postcode==PH19)||($postcode==PH20)||($postcode==PH21)||($postcode==PH22)||($postcode==PH23)||($postcode==PH24)||($postcode==PH25)||($postcode==PH26)||($postcode==PH27)||($postcode==PH28)||($postcode==PH29)||($postcode==PH30)||($postcode==PH31)||($postcode==PH32)||($postcode==PH33)||($postcode==PH34)||($postcode==PH35)||($postcode==PH36)||($postcode==PH37)||($postcode==PH38)||($postcode==PH39)||($postcode==PH40)||($postcode==PH41)||($postcode==PH42)||($postcode==PH43)||($postcode==PH44)||($postcode==PH49)||($postcode==PH50)||($postcode==P030)||($postcode==P031)||($postcode==P032)||($postcode==P033)||($postcode==P034)||($postcode==P035)||($postcode==P036)||($postcode==P037)||($postcode==P038)||($postcode==P039)||($postcode==P040)||($postcode==P041)||( preg_match( '/BT\d{1,2}/i', $postcode ))||( preg_match( '/HS\d{1,2}/i', $postcode ))||( preg_match( '/ZE\d{1,2}/i', $postcode ))||( preg_match( '/IM\d{1,2}/i', $postcode ))||( preg_match( '/JE\d{1,2}/i', $postcode ))||( preg_match( '/GY\d{1,2}/i', $postcode )))
{$custom = array('Scottish Highlands, UK Isles & Northern Ireland(2-3 Days)' => '49.95');}

else {     $method  = 'UK Shipping';
     $total = '0.00';
     $custom = array($method => $total);}}

$this->globals('ecom.customship_response',$custom);


?>

- Euorpacart 8

Offline

 

#7 08-13-2009 10:15:01

nephiko
Member
Registered: 03-19-2009
Posts: 9

Re: Shipping with UK Postcodes

Took some working out, and trial and error, but i have got it done, thanks a lot for your help.

Offline

 

Board footer