Balefire Posted July 18, 2009 Share Posted July 18, 2009 Hi there,trying to get my head around this one. We use Parcelforce for shipping larger packages and they add a "fuel surcharge" for some areas of the UK - namely Scottish Highlands, Isle of Man, Scilly Isles, Shetland Isles & a couple of others. How would I set up shipping to take this into account? Each of these areas are charged at a different rate.I first thought about using different zones, but UK (Scottish Highlands), UK (Isle of Man), etc as zone names would look wrong on the invoice address and customers could accidentally or deliberately choose the wrong zone to avoid the surcharge.On further investigation I have found out that other UK carriers do exactly the same, so this cannot be a unique requirement! Link to comment Share on other sites More sharing options...
Balefire Posted August 8, 2009 Author Share Posted August 8, 2009 Okay, so judging by the response I guess there is chance of that.Alternative - is it possible (via a module) to change the logic of shipping from zone to Postcode? If so, is there any module documentation and where is it? Link to comment Share on other sites More sharing options...
radders Posted August 8, 2009 Share Posted August 8, 2009 I don't think zone appears on the invoice address does it?Untested but according to the documentation I read, zones are concerned with shipping and states are for the address. Link to comment Share on other sites More sharing options...
Balefire Posted August 8, 2009 Author Share Posted August 8, 2009 I don't think zone appears on the invoice address does it?Untested but according to the documentation I read, zones are concerned with shipping and states are for the address. In the Carrier settings you can only specify which Zone the courier will deliver to. Business Post (for example) split the UK into 5 separate areas, each with their own delivery charge for the same parcel. Scotland is split into two distinct Business Post shipping zones. Business Post Zone B includes the Scottish Lowlands and the North of England at £7.34 whereas Business Post Zone C is for the Scottish Highlands and is £20.12!Currently this is impossible to account for in PrestaShop and we have to tell the customer that they will be charged extra to get their delivery if they are in such an area. Which they will be invoiced for and is to be paid prior to the item being shipped. Not the best situation as you can imagine.What I am proposing is the ability (in a specific courier shipping module) to hook into and extend the shipping scheme to use the Postcode entered by the client if they select United Kingdom as their country. If it is possible, that is, but without any API or developer's documentation it is difficult to know where to start without first studying the current source code. I have an idea on how to do it, but I currently do not have the knowledge of PrestaShop coding standards to do this easily. Link to comment Share on other sites More sharing options...
OurManFlint Posted December 1, 2009 Share Posted December 1, 2009 Hi folks,I'm having the same issue and there doesn't seem to be a solution available several months later.Has anyone got a solution to this?? I'm willing to pay for a successful module/update.Regards,Ash Link to comment Share on other sites More sharing options...
peeps54 Posted January 31, 2010 Share Posted January 31, 2010 Hi, yep same/similar problem, UK based client, uses Royal Mail small packages but needs to be able to offer insurance plus larger packages as explained abovealso someway of combining items for a maximum cost (or is that here somewhere?)Not sure if this will work:-Toying with setting up unique weight matrix to each postal cost:1 gram £1.50 second class 3 day2 gram £3.00 (includes insurance)3 gram £2.50 1st Class recordedetc etcor is there a module on its way, or in the beta ver?/--- Paul Link to comment Share on other sites More sharing options...
Eck! Posted February 20, 2010 Share Posted February 20, 2010 Ive just come across this problem too. Ive written a cludgey workaround for now which check the fioirst two digits of postcode and changes the zone accordingly, but its hard-coded and would be much nicer if it were an option. //Check zone against entered postcode $postcodes = array('BT','AB','DD','FK','G8','HS','JE','IM','IV','KA','KW','PA','PH','ZE'); $pc = Tools::getValue('postcode', 8); $pc = strtoupper(substr(trim($pc),0,2)); foreach($postcodes as $p) if(!strcmp($pc,$p)) { $id_zone = 9; $cart->id_carrier = 9; } Link to comment Share on other sites More sharing options...
sgtbash Posted April 13, 2010 Share Posted April 13, 2010 I've encountered the same problem with the shipping rates for Scottish highlands, Northern Ireland & Isle of Scilly all being so much more with the courier, but actually still part of the UK.I've ended up setting up States within the UK, of England, Scottish Highlands, Northern Ireland etc and set new carries to service those areas.Its an annoying work around but prevents loosing (in some cases a lot) money when someone puts UK when they are actually in somewhere offshoreI can post up printscreens if anyone wants themDan Link to comment Share on other sites More sharing options...
LukeH Posted June 19, 2010 Share Posted June 19, 2010 Ive just come across this problem too. Ive written a cludgey workaround for now which check the fioirst two digits of postcode and changes the zone accordingly, but its hard-coded and would be much nicer if it were an option. //Check zone against entered postcode $postcodes = array('BT','AB','DD','FK','G8','HS','JE','IM','IV','KA','KW','PA','PH','ZE'); $pc = Tools::getValue('postcode', 8); $pc = strtoupper(substr(trim($pc),0,2)); foreach($postcodes as $p) if(!strcmp($pc,$p)) { $id_zone = 9; $cart->id_carrier = 9; } Could you tell me where you put this code to take effect? I would like to implement something similar for my shop.ThanksLuke. Link to comment Share on other sites More sharing options...
JungleJap Posted July 23, 2010 Share Posted July 23, 2010 Hi there,I've had the same issue as well. As a work around I split the UK into six zones like below and set up the delivery charge separately.United Kingdom (Mainland)United Kingdom (Scottish Highland) United Kingdom (Scottish Island) United Kingdom (Northern Ireland) United Kingdom (Isle of Scilly, Isle of Wight) United Kingdom (Isle of Man)I'm not sure if this is the best solution but it seems to work fine so far. This site isn't live yet so it's not tested in the real world yet. Has anybody out there tried something like this?Rio Link to comment Share on other sites More sharing options...
wicker Posted August 1, 2010 Share Posted August 1, 2010 Hi all,Same problem for Spain and Canary Islands.Does anybody know which is the info of the client's "delivery address" fields that is used to calculate the cost of delivery? is it the COUNTRY? or POSTAL CODE? or CITY?Thanks in advance Link to comment Share on other sites More sharing options...
wicker Posted August 1, 2010 Share Posted August 1, 2010 Finally, I had to create a NEW Country which is called "Spain - Canary Islands"It is a pitty that PS does not have a nice, elegant and reliable solution for these kind of needs. Link to comment Share on other sites More sharing options...
Eck! Posted September 15, 2010 Share Posted September 15, 2010 Could you tell me where you put this code to take effect? I would like to implement something similar for my shop.ThanksLuke. Replied by PM, but for the benefit of others, this would go into order.php near the bottom of the main code (ie: before any functions). The $zone_id value would need to be set to the appropriate zone ID for Highlands and Islands (Mine is 9, but it could be anything).In addition, I also use a different carrier for zone 9, so I added the following: if($id_zone==9) { //Need to change shipping price to different carrier $cart->id_carrier = 11; } else { if (isset($_POST['id_carrier']) AND Validate::isInt($_POST['id_carrier']) AND sizeof(Carrier::checkCarrierZone(intval($_POST['id_carrier']), intval($id_zone)))) $cart->id_carrier = intval($_POST['id_carrier']); elseif (!$isVirtualCart) $errors[] = Tools::displayError('invalid carrier or no carrier selected'); } $cart->update(); So the whole thing looks like this (I cant specify line numbers as I have several modifications on order.php): if (!$id_zone = Address::getZoneById($address->id)) $errors[] = Tools::displayError('no zone match with your address'); //Check zone against entered postcode $postcodes = array('BT','AB','DD','FK','G8','HS','JE','IM','IV','KA','KW','PA','PH','ZE','AK'); $pc = Tools::getValue('postcode', 8); $pc = strtoupper(substr(trim($pc),0,2)); foreach($postcodes as $p) if(!strcmp($pc,$p)) { $id_zone = 9; } if($id_zone==9) { //Need to change shipping price to different carrier $cart->id_carrier = 11; } else { if (isset($_POST['id_carrier']) AND Validate::isInt($_POST['id_carrier']) AND sizeof(Carrier::checkCarrierZone(intval($_POST['id_carrier']), intval($id_zone)))) $cart->id_carrier = intval($_POST['id_carrier']); elseif (!$isVirtualCart) $errors[] = Tools::displayError('invalid carrier or no carrier selected'); } $cart->update(); } # if(!sizeof($errors)) if (sizeof($errors)) { $smarty->assign('errors', $errors); displayCarrier(); include(dirname(__FILE__).'/footer.php'); exit; } $orderTotal = $cart->getOrderTotal(); } Link to comment Share on other sites More sharing options...
James R Posted September 16, 2010 Share Posted September 16, 2010 Hi all,Same problem for Spain and Canary Islands.Does anybody know which is the info of the client's "delivery address" fields that is used to calculate the cost of delivery? is it the COUNTRY? or POSTAL CODE? or CITY?Thanks in advance Anyone figure this one out as I'm wondering if I'm going to have to remind customers to enter "Northern Ireland" (added country and zone) in their country field to avail of free shipping. Link to comment Share on other sites More sharing options...
shelmin Posted August 14, 2011 Share Posted August 14, 2011 if (!$id_zone = Address::getZoneById($address->id)) $errors[] = Tools::displayError('no zone match with your address'); //Check zone against entered postcode $postcodes = array('G3','G4'); $pc = Tools::getValue('postcode', 8); $pc = strtoupper(substr(trim($pc),0,2)); foreach($postcodes as $p) if(!strcmp($pc,$p)) { $id_zone = 9; } if($id_zone==666) { //Need to change shipping price to different carrier $cart->id_carrier = 11; } else { if (isset($_POST['id_carrier']) AND Validate::isInt($_POST['id_carrier']) AND sizeof(Carrier::checkCarrierZone(intval($_POST['id_carrier']), intval($id_zone)))) $cart->id_carrier = intval($_POST['id_carrier']); elseif (!$isVirtualCart) $errors[] = Tools::displayError('invalid carrier or no carrier selected'); } $cart->update(); } # if(!sizeof($errors)) if (sizeof($errors)) { $smarty->assign('errors', $errors); displayCarrier(); include(dirname(__FILE__).'/footer.php'); exit; } $orderTotal = $cart->getOrderTotal(); } Tried this on PS1.4.4 and it's not working. I got zone xxx with id=9 and added that zone to my carrier, I have put my local postcode during registration, so that first 2 digits are matching those from the hard coded list. Added code to /classes/order.php line 184 It hasn't changed anything, zone(europe) is still chosed by country as it was before. Anybody please help, i am trying to set diferent prices for diferent postcode groups to offer local same day delivery. Thanks Link to comment Share on other sites More sharing options...
mr2bitz Posted January 4, 2016 Share Posted January 4, 2016 I've encountered the same problem with the shipping rates for Scottish highlands, Northern Ireland & Isle of Scilly all being so much more with the courier, but actually still part of the UK. I've ended up setting up States within the UK, of England, Scottish Highlands, Northern Ireland etc and set new carries to service those areas. Its an annoying work around but prevents loosing (in some cases a lot) money when someone puts UK when they are actually in somewhere offshore I can post up printscreens if anyone wants them Dan Hi Dan / All I know this is an old post BUT I am facing the same problem. Any chance you could post up how you created these states for the UK so I can get these done for my site. Im using PS 1.6.1. Thanks in advance. Ade Link to comment Share on other sites More sharing options...
sgtbash Posted January 5, 2016 Share Posted January 5, 2016 Any chance you could post up how you created these states for the UK so I can get these done for my site. Hey, I'll have a look at the new 1.6 way of doing things (not been using Prestashop for a few years now as have moved jobs) but it shouldn't be too much different or hard to achieve. Worked quite well once done, and didn't confuse customers either which was always a bonus. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now