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.

#26 09-19-2019 08:16:31

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19367
Website

Re: Shipping surcharge per post code

Change:

Code:

if (( preg_match( '/EC\d{1,2}/i', $postcode ))||( preg_match( '/NW\d{1,2}/i', $postcode ))||( preg_match( '/SE\d{1,2}/i', $postcode ))||( preg_match( '/SW\d{1,2}/i', $postcode ))||( preg_match( '/WC\d{1,2}/i', $postcode ))||( preg_match( '/E\d{1,2}/i', $postcode ))||( preg_match( '/N\d{1,2}/i', $postcode ))) {

     $method .= ' with Inner London Surcharge';
     $total  += 1.00;

} // End of if statement.

To:

Code:

$dosurcharge = 0;

if     (preg_match('/EC\d{1,2}/i', $postcode)) {$dosurcharge++;}
elseif (preg_match('/NW\d{1,2}/i', $postcode)) {$dosurcharge++;}
elseif (preg_match('/SE\d{1,2}/i', $postcode)) {$dosurcharge++;}
elseif (preg_match('/SW\d{1,2}/i', $postcode)) {$dosurcharge++;}
elseif (preg_match('/WC\d{1,2}/i', $postcode)) {$dosurcharge++;}
elseif (preg_match('/E\d{1,2}/i', $postcode))  {$dosurcharge++;}
elseif (preg_match('/N\d{1,2}/i', $postcode))  {$dosurcharge++;}

if ($info['stateprov'] != 'London') {$dosurcharge = 0;}

if (!(empty($dosurcharge))) {

     $method .= ' with Inner London Surcharge';
     $total  += 1.00;

} // End of if statement.

Nick Hendler

Offline

 

#27 09-19-2019 08:38:57

west4
Member
From: UK
Registered: 04-16-2008
Posts: 627
Website

Re: Shipping surcharge per post code

Hi Nick,

I think that's it..

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

Board footer