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 03-24-2009 05:16:47

custompod
Member
Registered: 03-25-2008
Posts: 77

Shipping defaulting to £10??

Hi Guys,

Last night I "tweaked" the amount of postage that I charge in the "manage custom shipping methods" as I have done in the past and the first order I get this morning has a postal charge of £10 to the UK when it should be £1.99???

The code is below and I only changed the amounts (although not sure why it is in there twice for worldwide but changed them both).
Can anyone help please?
Many thanks, Neil barker.

wwwAppleiPodParts.com

Code:

$info = $this->globals('ecom.customship');

if (($info['country'] == 'UK - England & Wales')||($info['country'] == 'UK - Scotland Mainland')||($info['country'] == 'UK - Highlands & Islands Scotland')||($info['country'] == 'UK - Isle of Man')||($info['country'] == 'UK - Channel Islands')||($info['country'] == 'UK - Northern Ireland')){
// UK shipping

$method  = 'UK Recorded Delivery';
$total = '1.99';
$custom = array($method => $total);


} elseif (($info['country'] == 'Ireland')||($info['country'] == 'Cyprus')||($info['country'] == 'Finland')||($info['country'] == 'Gibraltar')||($info['country'] == 'Hungary') ||($info['country'] == 'Iceland')||($info['country'] == 'Norway') ||($info['country'] == 'Poland')||($info['country'] == 'San Marino')||($info['country'] == 'Slovenia') ||($info['country'] == 'Switzerland')||($info['country'] == 'Austria') ||($info['country'] == 'Belgium')  ||($info['country'] == 'Denmark') ||($info['country'] == 'France') ||($info['country'] == 'Germany') ||($info['country'] == 'Greece') ||($info['country'] == 'Italy') ||($info['country'] == 'Luxembourg') ||($info['country'] == 'Netherlands') ||($info['country'] == 'Portugal') ||($info['country'] == 'Spain') ||($info['country'] == 'Sweden')){
// European counties charge 
$method  = 'Mainland Europe Airmail Delivery;
$total = '2.49';
$custom = array($method => $total);


} else {
// Rest of the world £3.49
$method  = 'World Airmail Delivery';
$total = '3.49';
$custom = array($method => $total);

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

Offline

 

#2 03-24-2009 05:41:28

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Shipping defaulting to £10??

You changed more than just an amount and accidentally left a closing single quote off of a line which caused the script to be invalid and the shopper got your default shipping charge.

Change

Code:

$method  = 'Mainland Europe Airmail Delivery;

to

Code:

$method  = 'Mainland Europe Airmail Delivery';

Offline

 

#3 03-24-2009 05:45:20

custompod
Member
Registered: 03-25-2008
Posts: 77

Re: Shipping defaulting to £10??

Oh yes, sorry you are correct. I did change the description too... it was getting late!!

Many thanks for that, I will change it now and it saves me having to constantly refund postage all day!! lol

Many thanks, Neil.

Offline

 

#4 03-24-2009 10:43:03

RobH
Member
Registered: 02-12-2009
Posts: 117

Re: Shipping defaulting to £10??

I'd always test the shipping script immediately after changing it - it's really easy to miss something and get the default shipping charge (as you have found)

Offline

 

#5 03-24-2009 10:47:58

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Shipping defaulting to £10??

If you install PHP on your own machine the command line version of PHP has a -l switch (lint) which allows you to easily check for syntax errors before you even introduce the code to CCP.  It's what I used to find and identify the problem.

Offline

 

Board footer