14 replies [Last post]
jibbajabba's picture
Offline
Joined: 09/20/2008
Juice: 133

For some reason, my state/province field isn't updating when I change country in the checkout form. I think it did at some point. I recently updated ubercart, and not sure if that's got anything to do with it. Auto-complete works in other forms, e.g. taxonomy field in entry forms, so not sure what I've done wrong.

How would I troubleshoot this?

I'm using Ubercart 5.x-1.7

jibbajabba's picture
Offline
Joined: 09/20/2008
Juice: 133
Re: State/Province not auto-updating

Just tested in Garland theme, and it's not updating there either. Wierd.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: State/Province not auto-updating

Curious... it shouldn't be a version issue, however there might be some other JS error on the page interfering. I'd check for that.

jibbajabba's picture
Offline
Joined: 09/20/2008
Juice: 133
Re: Re: Re: State/Province not auto-updating

Painful. Other cart Javascript in the page appears to be functioning. I'm very close to jumping ship. So much work to get this to work.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: State/Province not auto-updating

Can you look on the Livetest and tell me if the JS there works for you? Could be a browser issue? That JS is tested regularly, and the Livetest always runs the latest code. That's what leads me to believe it's something else on your site... Can you post a link?

jibbajabba's picture
Offline
Joined: 09/20/2008
Juice: 133
Re: Re: Re: Re: Re: State/Province not auto-updating

It's definitely something wrong on my end. Livetest works for me, and I've been testing my store on different machines and browsers. I just can't figure out what's blocking it from firing.

Thanks for offering to take a peek, Ryan. The store is here: http://konigi.com/store

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3369
Re: Re: Re: Re: Re: Re: State/Province not auto-updating

Like Ryan thought, there's a JavaScript error on your checkout page which is preventing subsequent JavaScript on that page from functioning. (Firebug is great for finding these things, BTW). I suspect it's because you're using jQuery Update 1.0. I suggest either using jQuery Update 2.0 or disabling jQuery Update entirely.

<tr>.
jibbajabba's picture
Offline
Joined: 09/20/2008
Juice: 133
Re: Re: Re: Re: Re: Re: Re: State/Province not auto-updating

Brilliant! Thanks, TR. Updating JQuery_Update to 2.x fixed it. Thank you both for the quick and helpful responses.

japo32's picture
Offline
Joined: 03/17/2010
Juice: 8
6.0

Hi Guys. I recently moved my drupal site to a different directory folder in the same hosting.

When I did that the autoupdate of the State/Province suddenly stopped loading values.

For example when I first go to the Checkout page everything loads fine, all the State/Province of the Philippines loads.
but when I switch the country to the US for example, the dropdown for State/Province becomes empty.

i'm sure this has something to do with the change of folders but i'm stumped where to look. Sad

I'm using ubercart-6.x-2.1

japo32's picture
Offline
Joined: 03/17/2010
Juice: 8
japo32 wrote: Hi Guys. I
japo32 wrote:

Hi Guys. I recently moved my drupal site to a different directory folder in the same hosting.

When I did that the autoupdate of the State/Province suddenly stopped loading values.

For example when I first go to the Checkout page everything loads fine, all the State/Province of the Philippines loads.
but when I switch the country to the US for example, the dropdown for State/Province becomes empty.

i'm sure this has something to do with the change of folders but i'm stumped where to look. Sad

I'm using ubercart-6.x-2.1

i made a workaround and removed the state/province field completely. I just labeled the "City" field as State/Province.
it kinda works but im still bothered with the autoupdate thing not working Sad

leslie's picture
Offline
Joined: 03/24/2010
Juice: 3
Same Problem - State/Province not updating

I'm having the same problem as jibbajabba, in the checkout. The only "extra" javascript we've added is to select a stylesheet based on browser - very basic.
Page: http://diversityjournal.com/cart/checkout
Any suggestions? Help is most welcome!

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3369
Re: Same Problem - State/Province not updating

Firebug shows an error on that page: Failed to load source for: http://diversityjournal.com/home?q=uc_js_util/zone_select
That error should also show up in your server logs.

I'm guessing you've installed Drupal in a subdirectory "home" and are using pathauto or .htaccess rules to re-write your URLs, causing the Ajax to fail.

<tr>.
James Lawson's picture
Offline
Joined: 01/28/2010
Juice: 56
Re: State/Province not auto-updating

I'm having the same issue with a friends website. Www.nicksentience.com when I go through the checkout and try and change the country on the order form the state/province doesn't update properly giving the user an error message. If the user then presses submit again they get a second error message but are then able to update the state/province.

Of course most people won't do what I did (press submit again) so orders are being lost.

Any ideas anyone?

With thanks

James

firewing1's picture
Online
Joined: 07/07/2009
Juice: 118
index.html

If you're using an Apache web server, this may have to do with your DirectoryIndex setting (I don't know what the corresponding setting is for IIS or others). In uc_store/uc_country_select.js you can see that the URL for retrieving the country's state/provinces is "?uc_js_util/zone_select", so if you have an index.html file in place and it has higher precedence than index.php, it gets loaded instead of Drupal handling the query.

To fix, edit uc_country_select.js and simply change all instances of "?uc_js_util/zone_select" with "index.php?uc_js_util/zone_select".

end user's picture
Online
Joined: 01/11/2008
Juice: 916
Re: Re: State/Province not auto-updating

Hmm when I went to the cart all I got was paypal button that led me to paypal there was no UC checkout forms on there. Also when I add an item I'm taken to a new browser window which is a bit confusing.