Billing address zone not filled correctly.
It occurs with logged in users (only logged in users are allowed to order on this site), it only happens with the billing address, the delivery address works fine.
I searched a bit and found out that function uc_zone_select( ) is called twice for the Billing address.
First time it is called by
Location: http://#siteurl#/cart/checkout
and empty Referer.
This has the right results.
Immediately thereafter the function is called a second time:
Location: http://#siteurl#/?q=uc_js_util/zone_select
Referrer: http://#siteurl#/cart/checkout
This one has NO #default_value
So it seems the javascript function, which triggers after a country change, is called.
Don't know yet why that happens, because the country is set by the server and not by the client.
Comments
Comment #1
catorghans commentedIt only happens when module uc_vat_number is active. I'll look further to see if it still is an issue for this project and how to resolve it.
Comment #2
freixas commentedThe addresses on the checkout form are handled by Ubercart, not uc_addresses. I just copy the final result into the uc_addresses database tables.
To verify if this is a uc_addresses problem, please disable uc_addresses and then see if the problem still appears. If the problem no longer occurs, you will need to submit the bug to either Ubercart or uc_vat_number (sounds like the latter may be more appropriate).
You may also want to describe the problem a little better. In what way is the billing address zone incorrect? If someone wanted to reproduce the problem, what would they have to do and how would they know they duplicated the same problem?
Comment #3
catorghans commentedThe problem is that the billing zone stays empty, while every other field is filled in correctly.
It only happens with uc_vat_number active.
It is a problem of that code.
It adds the following line:
drupal_add_js('$(document).ready(function() { $("#edit-panes-billing-billing-country").change(); });', 'inline');
which itself triggers the "change" event on that field (although the field is not changed) and that executes among others:
" uc_update_zone_select(this.id, ''); "
which is called whithout a "default" and that makes the zone field becomes empty.
I will close it here. And make a new one in uc_vat_number.
(A vat number in uc_addresses if "uc_vat_number" is active, would be a very nice feature)
Comment #4
freixas commentedThanks for closing out this bug report.
As for the extra feature—I don't know what uc_vat_number is or what it has to do with addresses. In any case, if you want this feature, you could always donate a patch. It would have to have a negligible effect on sites that don't use uc_vat_number.
Comment #5
catorghans commentedYes, I am thinking about such a patch :)
A vat number is required for trade between businesses in european countries and is part of the (billing) address.
Vat handling might become part of ubercart core in the future.