A nice fix is coming ... thanks for the updates ...![]()
A nice fix is coming ... thanks for the updates ...![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Originally Posted by Ajeh
Isn't there any fix for this particular issue yet ? This is the only thing that is keeping me from going live... any help would be great...![]()
Ok guys... i think i've found a fix...
After some analisys i think i found it... well.. if this "add address" process is ok when creating a new account this would mean that the code is already implemented. So the problem was that this wasn't being checked when adding a new address from on other page besides the initial "new account".
I found that the code in question is :
PHP Code:if (ACCOUNT_STATE == 'true' && ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true') {
$zone_id = 0;
$check_query = "select count(*) as total
from " . TABLE_ZONES . "
where zone_country_id = '" . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY . "'";
$check = $db->Execute($check_query);
$entry_state_has_zones = ($check->fields['total'] > 0);
if ($entry_state_has_zones == true) {
$zones_array = array();
$zones_array[] = array('id' => PULL_DOWN_ALL, 'text' => PULL_DOWN_ALL);
$zones_values = $db->Execute("select zone_name
from " . TABLE_ZONES . "
where zone_country_id = '" . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY . "'
order by zone_name");
while (!$zones_values->EOF) {
$zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']);
$zones_values->MoveNext();
}
}
}
wherewould be the dropdown checking that wasn't being checked.PHP Code:ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true'
So.. my advise is always to backup before doing what i am going to explain next.
Hey.. BACKUP!!
Just insert this piece of code on the includes/modules/checkout_new_address.php so it becomes like this :
(comented code is new to the file)
PHP Code:<?php
/**
* checkout_new_address.php
*
* @package modules
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: checkout_new_address.php 3777 2006-06-15 07:03:03Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/**
* NEW CODE FROM THIS POINT ON
*/
if (ACCOUNT_STATE == 'true' && ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true') {
$zone_id = 0;
$check_query = "select count(*) as total
from " . TABLE_ZONES . "
where zone_country_id = '" . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY . "'";
$check = $db->Execute($check_query);
$entry_state_has_zones = ($check->fields['total'] > 0);
if ($entry_state_has_zones == true) {
$zones_array = array();
$zones_array[] = array('id' => PULL_DOWN_ALL, 'text' => PULL_DOWN_ALL);
$zones_values = $db->Execute("select zone_name
from " . TABLE_ZONES . "
where zone_country_id = '" . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY . "'
order by zone_name");
while (!$zones_values->EOF) {
$zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']);
$zones_values->MoveNext();
}
}
}[/B]
/**
* NEW CODE ENDED HERE
*/
/**
* determine pulldown menu contents if appropriate
*/
Give it a try... and post some feedback. Hope i got it... and remember.. always backup!! ;)![]()
Last edited by joanorsky; 4 Aug 2006 at 04:07 PM.
joanorsky,
This fix seems to be working for me.
Thanks!!
LadyHLG
It looks like this fix only works if admin > configuration > customer details > state always display as pulldown = true.
Unfortunately, if you are sending anywhere but the US, that method forces non-US addresses to choose US states, right?
Anyone have a fix for this? It's a sale-killer.
Since we have very few international orders I might use it for now.
---Diana
Originally Posted by dbrewster
Well this fix is only for the pulldown = true condition... but it works on all countries. You just have to insert the zones manually.. otherwise it will fail.. of course..
... maybe i did not understood your meaning...![]()
Well, even for countries that have some zones in the database, the drop menu does not show them. If I say I am shipping to Switzerland, I see a drop list with... US states in it.Originally Posted by joanorsky
So, international shipping is broken for me until we have a fix.![]()
Not that we do much of that at all, but, still.
but perhaps I have a misconfiguration somewhere? suggestions??
This fixed it!!!
I just had to remove: [/b] from the posted code and after doing 1 hour of testing with the address book, taxes are being charged correctly.
Thanks so much for posting the solution!
Gisèle Grenier
This code still does not handle where a country has no zones in the zones table (i.e. states or provinces), when you choose state droplist required.
There is another bug with this code: if you want to change your mailing address to a different country, you only see a drop list for states for your original country.
We have lost some international orders because of this... however, we have very few international orders, so it's not a big issue for us.
If I remove the requirement for the drop list of states, then international orders work (except for those countries that always mysteriously fail USPS delivery, such as Cyprus and Switzerland, which may be due to a bug in USPS code.)
---Diana
There's an old adage that says that out of 'quick', 'cheap' and 'good', you can't have more than 2 at the same time. So if it's 'free' and you want it 'good', then it can't be quick. All of which is by way of saying that I'm ashamed to admit that news of a Zen core-team fix for what has always been one of the major bug-bears in the osC/Zen create account interface - the defined State/Zone kick-back problem - put me in a state roughly equivalent to a 5-year-old waiting for Christmas. If Ajeh says it's good, then it must be good! I know that asking when it might be ready is about as inappropriate as asking Father Christmas to get-a-move-on down the chimney. But I can't help myself. Just don't kick me too hard! Pleez?Originally Posted by Ajeh
![]()