Forums / Built-in Shipping and Payment Modules / Zone rates - specific country not calculating postage

Zone rates - specific country not calculating postage

Locked

Started by robmurg on 21 Mar 2008, 7:00 AM · Views: 2,129

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
21 Mar 2008, 7:00 AM
#1
robmurg avatar

robmurg

New Zenner

Join Date:
May 2006
Location:
UK.
Posts:
5
Plugin Contributions:
0

Zone rates - specific country not calculating postage

Hi,
I hope someone can help me with this problem, I've tried for a couple of days to solve it on my own.
I use zone rates for shipping and have set up three zones as follows:
Zone 1 Countries
GB
Zone 2 Countries
ES,AT,BE,CH,CY,CZ,FI,FR, FX,DE,GI,GR,IE,IT,LU,MT,NO,NL,PL,PT,DK,SE,SI
(Note the ES at the start of that row)
Zone 3 Countries
US,CA,AT,GL,IS,IL,JP,AU,NZ,SG,TW,CN,HK,ZA

Most countries calculate their postage without problems, but when people from Spain (ES) try to order they are not quoted for postage and can't check out. Other countries in zone 2 seem to be OK.
I can't see the problem with Spain? It is set up as a country having zones in the zones table, but so is Germany for example and I can check out fine using a German (DE) address. I've hunted through the documentation and the forums and tried to see what is different about Spain in the database, but to no avail. I've tried 'ES' in various positions in the table above in case that was the problem, currently it's first in the list but does not work in the middle or the end either.
I'm running version 1.3.8 having recently upgraded from about 1.3.0 or so.
Thanks for any help you can offer on this.

21 Mar 2008, 9:53 AM
#2
robmurg avatar

robmurg

New Zenner

Join Date:
May 2006
Location:
UK.
Posts:
5
Plugin Contributions:
0

Re: Zone rates - specific country not calculating postage

OK, been hacking all morning and think I understand the problem and have a solution which I present in case anyone else has the same problem or can see a flaw with it:

In the zones postage calculation there is a check to see if the customer's country is in a list where postage is not permitted:
if (strstr(MODULE_SHIPPING_ZONES_SKIPPED, $dest_country)) { ... don't offer postage ... }

In my shop the list was not initialised (and I can't see where to do that in the admin pages).
That meant it was comparing the country to the actual phrase MODULE_SHIPPING_ZONES_SKIPPED and matching on ES (in ZONES) and skipping shipping.

The MODULE_SHIPPING_ZONES_SKIPPED is a configuration constant so I added it to my configuration database table with an empty value for skipped countries, based on this line from the zones.php file:
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, c
onfiguration_description, configuration_group_id, sort_order, set_function, date_added) values ('Skip Countries, use a comm
a separated list of the two character ISO country codes', 'MODULE_SHIPPING_ZONES_SKIPPED', '', 'Disable for the following C
ountries:', '6', '0', 'zen_cfg_textarea(', now())");
and that seems to have done the trick. Maybe this is something I've messed up during the upgrade from my old shop 1.3.9?

21 Mar 2008, 11:44 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Zone rates - specific country not calculating postage

Good practice with all upgrades is to write down the settings for all your shipping and payment modules, then Uninstall them (click Remove in admin area), then re- Install them and set up the settings again. This results in setting up any missing parameters such as you describe.
This is generally mentioned in the upgrade documentation, but was probably not specifically mentioned for your module for the version you upgraded to simply because it applied to one of the interim upgrades.
Improvements are planned to help prevent this issue in the future, but until then, check all your activated modules similarly.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Apr 2008, 5:52 PM
#4
markrs avatar

markrs

New Zenner

Join Date:
Jul 2006
Location:
Wiltshire, England
Posts:
69
Plugin Contributions:
0

Re: Zone rates - specific country not calculating postage

So is this configurable from the admin pages?
If so, where, please.

Regards
Mar

11 Apr 2008, 6:53 PM
#5
robmurg avatar

robmurg

New Zenner

Join Date:
May 2006
Location:
UK.
Posts:
5
Plugin Contributions:
0

Re: Zone rates - specific country not calculating postage

I configured Zone rates by going to shipping in the modules menu and installing and configuring it if that's what you mean. The 'ES' problem involved opening up the database and adding the ZONE_RATES_SKIPPED entry manually which was a bit more involved. Dr Byte is suggesting that my problem could have been avoided if I'd un-installed zone rates before I upgraded from an older Zen-cart recently. That would have saved some bother!

12 Apr 2008, 12:44 PM
#6
markrs avatar

markrs

New Zenner

Join Date:
Jul 2006
Location:
Wiltshire, England
Posts:
69
Plugin Contributions:
0

Re: Zone rates - specific country not calculating postage

robmurg:

The 'ES' problem involved opening up the database and adding the ZONE_RATES_SKIPPED entry manually which was a bit more involved.
Indeed, but that was my question, as indeed was asked by the previous person. So I'm assuming the answer is "No, from this point it's not configurable from the admin i/f".