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.
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
$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
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
$method = 'Mainland Europe Airmail Delivery;
to
$method = 'Mainland Europe Airmail Delivery';
Offline
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
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
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