[Done 1.3.5] zone_name Bug - e.g. London & Londonderry
PROBLEM:
Create 2 zones for a country with zone_name as one word (no spaces) where the first characters of the zone_name are identical e.g. London and Londonderry.
In my case:
zone_name = Londonderry, zone_id = 329
zone_name = London, zone_id = 332
Now, try to create an account with zone_name London. The account will be created but the zone_name entered will be Londonderry - the first on the list in zone_id order.
Now try to edit the address book entry to London. This works OK in Admin, but trying to do it from the customer's end returns the error:
Please select a County/State from the County/State drop-down menu below.
BUG APPLIES TO:
1.2.7d certainly, but a previous report of the same bug by profitshock http://www.zen-cart.com/forum/showthread.php?t=33138 suggests it's also in the 1.3 series.
PARTIAL SOLUTION:
In Admin, insert a space into one of the zone_names e.g. change London to London Town.
Trouble is that London is one of the biggest customer bases in the UK, so any discouragement to registering an account is quite a problem. Any comments or ideas for fixes would be much appreciated.
Re: zone_name Bug - e.g. London & Londonderry
Well then...
I've checked out 1.3.0.2 and it has exactly the same bug. What's more surprising is so does osCommerce :shocking:
On the oscCommerce forum I found this post from Thomas Steven:
http://forums.oscommerce.com/index.p...9&#entry536359
Apparently, the SQL $zone_query -
$zone_query = tep_db_query("select distinct zone_id
from " . TABLE_ZONES . "
where zone_country_id = '" . (int)$country . "'
and (zone_name like '" . tep_db_input($state) . "%'
or zone_code like '%" . tep_db_input($state) . "%')");
- is actually looking for a zone_name that has the same first characters as the input. So it's no surprise that when it finds 2 (London and Londonderry) it gets its nickers in a right old twist.:smile:
Thomas suggests changing this line:
and (zone_name like '" . zen_db_input($state) . "%'
to:
and (zone_name = '" . zen_db_input($state) . "'
or zone_name like '" . zen_db_input($state) . "'
I've searched the Zen 1.3.0.2 code and there seem to be 3 files using $zone_query = "select distinct zone_id ...
includes\modules\create_account.php
includes\modules\pages\address_book_process\header_php.php
includes\modules\checkout_new_address.php
I tried changing one of these files: includes\modules\create_account.php
That seems to solve the problem - but I don't know what repercussions that could have on the rest of Zen Cart operations.
I don't know exactly what the other 2 files do and if they need changing or not. But whilst sorting this out I noticed another issue with addresses in 1.3.0.2 which is currently ongoing on: http://www.zen-cart.com/forum/showth...ng+address+tax
Upshot is that I won't be attempting to change the other 2 files until the tax issue has been resolved and I have a stable base to experiment on.
Re: zone_name Bug - e.g. London & Londonderry
I am affected by this bug can the core team please advise. The website I have this issue with is www.skintightrubber.com.
Regards
Mark.
Re: zone_name Bug - e.g. London & Londonderry
There are a number of files involved with this fix. It will be included in the next release.