• Welcome to KonaKart Community Forum. Please login or sign up.
 

Bug: Recording addresses without State

Started by Burz, February 12, 2007, 04:34:44 am

Previous topic - Next topic

Burz

I have just installed KK and when I use the example configuration to create an account, the entry_state field in address_book is recorded as NULL.

When I go back to view my address in the app, it always says the state is "Maine".

paolo

The recording of the state can work in one of two ways.

If the country has zones associated with it (the US does have zones in the default DB that we ship) then the UI forces you to choose a state from the list of zones if it doesn't recognise the state that you entered to be a valid state. When you pick a state from the zone list, we save the stateId in the entry_zone_id field and the entry_state field remains null. Your entry_zone_id should contain the id of 29 for Maine.

If the country doesn't have a list of zones, then the UI allows you to enter any value for the state and we save that value in the entry_state field.

Burz

Thanks for your reply.

When I register a new user, the /CustomerRegistration.do page displays a full form with the 'Your Address' section asking for:
Street Address (text)
Suburb (text)
Post Code (text)
City (text)
State/Province (text)
Country (drop-down list)

If I change the country to USA then nothing changes for state: It is still a plain text box. So I type in 'MA' and KK records this as zone index #29 (Maine) instead of #32 (Massachusetts). Perhaps KK is improperly associating 'MA' with the first two letters of the zone_name name, instead of checking first if the input is a two-letter abbreviation and then matching against the zone_code.

paolo

The new point release of KonaKart available from our web site (2.1.0.3) should fix the problem. The algorithm has been made smarter. The logic is now:

-If the entered text matches a code or a name, we then take it.
-If we don't get a direct match and get back more than one result, we then provide the drop list.
-If we don't get a direct match but there is only one result, we take it.

Obviously, if someone doesn't like the above algorithm, the UI could be modified to always show a drop list.


Burz

Thanks, I'm downloading it now.

What do you recommend for someone wanting to make modifications to KonaKart who knows only basic Java and JSP? A guide to struts?

paolo

It certainly helps to understand struts. For small changes, I'd try to understand what is already there and to modify the existing JSPs and Struts actions. For large changes (i.e. a completely new client) you could use the web services interface which would allow you to use whatever technology you are most comfortable with.

andrea.castelli

I would like to implement an AJAX call that, after the country is selected, provides a list of states available.

Which server-side function should I call from my new AJAX call?
I found usefull api in konakartadmin-jar but not in konakart.jar.

Thank you.
Andrea

trevor

Try:

public ZoneIf[] getZonesPerCountry(int countryId) throws KKException;