The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 05-31-2010, 02:13 PM
celebration's Avatar
celebration is offline
 
Join Date: May 2010
Posts: 3
Default

State and Country fields in checkout


Store is set up ready to be launched apart from one issue I hope you can help with.

- products are for collection only so no weights assigned to them
- therefore no shipping method enabled (carrier-calculated or user-defined)
- on checkout page, country and state/region dropdown boxes hidden using CSS and javascript label method

This is where the problem lies - whenever trying to checkout it always comes up "Please select a State/Region"

The checkout fields are:
Full name
Address Line 1
Address Line 2
City
Postcode
Phone Number

The destination zone country is the UK only, I've tried just adding one state, multiple states, no states with and without a country assigned to the destination zone. I've also tried deleting the destination zone but it still displays a "Please select a State/Region" message when trying to checkout.

Unfortunately, we have to hide the Country or State dropdown boxes so this isn't an option.

Thanks
  #2  
Old 05-31-2010, 04:32 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by celebration View Post
Store is set up ready to be launched apart from one issue I hope you can help with.

- products are for collection only so no weights assigned to them
- therefore no shipping method enabled (carrier-calculated or user-defined)
- on checkout page, country and state/region dropdown boxes hidden using CSS and javascript label method

This is where the problem lies - whenever trying to checkout it always comes up "Please select a State/Region"

The checkout fields are:
Full name
Address Line 1
Address Line 2
City
Postcode
Phone Number

The destination zone country is the UK only, I've tried just adding one state, multiple states, no states with and without a country assigned to the destination zone. I've also tried deleting the destination zone but it still displays a "Please select a State/Region" message when trying to checkout.

Unfortunately, we have to hide the Country or State dropdown boxes so this isn't an option.

Thanks
Can you post a link to your store?
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #3  
Old 06-01-2010, 12:23 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Thank you for the link.

1. Destination zones aren't related this error. They're related to user-defined shipping rates and taxes: http://kb.ecwid.com/Destination-zones

2. At the moment Ecwid always requires valid country and state from customer during checkout. If no country or state is entered, customer will not be able to checkout.

You've hidden these fields. So if Ecwid cannot determine country & state based on customer IP, customer will not be able to finish the checkout process.

The solution is to use some custom JavaScript and change the value of these fields, when customer opens this checkout page.
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #4  
Old 06-02-2010, 12:47 PM
celebration's Avatar
celebration celebration is offline
 
Join Date: May 2010
Posts: 3
Default

Thanks for your reply

Yesterday, when visiting the checkout page, the city was automatically identified and filled in. During tests I re-enabled the state and country dropdown boxes in CSS so they showed. The country dropdown defaulted to United Kingdom while the state dropdown box default to "Please select a state".

However today, the city is not automatically found and as a result the country dropdown box defaults to "Please select a country" and the state dropdown box has turned into an input box.

I have managed to set a default value for City and Country using Javascript but cannot set a default value for the state yet. Has there been any changes to Ecwid from yesterday?

The code from firebug for the state input box
HTML Code:
<table id="gwt-uid-18" class="ecwid-AddressForm-state" cellpadding="0" cellspacing="0">
<colgroup><col></colgroup>
<tbody>
<tr>
<td><input maxlength="32" class="gwt-TextBox" tabindex="0" type="text"></td>
</tr>
</tbody>
</table>
Here's the code used to set a default value for city and country
HTML Code:
<script type="text/javascript">

function checkout_change() {
document.getElementById("gwt-uid-17").value="City value here";
var countryselect=document.getElementById("gwt-uid-20");
countryselect.options[0]=new Option("New 1st option", "GB","","selected"); //replace 1st option with a new one
}

window.onload = checkout_change; 
</script>
Any ideas how I can specify the default value of the state field would be gratefully received.

Thanks
  #5  
Old 06-02-2010, 03:24 PM
celebration's Avatar
celebration celebration is offline
 
Join Date: May 2010
Posts: 3
Default

Had another look at the page this afternoon and it has reverted back to a dropdown menu for the states

Anyway have got it working now - code below for anybody else who has a similar issue
HTML Code:
function checkout_change() {

//assign value to city input field
document.getElementById("gwt-uid-17").value="City Value Here";

//assign value to new option and make it the default
var countryselect=document.getElementById("gwt-uid-20");
countryselect.options[0]=new Option("New 1st option", "GB","","selected"); 

//target state table id and change first option value in select dropdown
//****EDIT - table id seems to change after every refresh***//
//var tableselect = document.getElementById("gwt-uid-18"); 
var tableselect = document.body;//probably not the most efficient way but it works
var selectoption = tableselect.getElementsByTagName("select")[0];
selectoption.options[0]=new Option("New 1st option", "Place Value Here","","selected");
}
window.onload = checkout_change; 

Last edited by celebration; 06-02-2010 at 03:41 PM.
  #6  
Old 06-03-2010, 12:34 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by celebration View Post
Had another look at the page this afternoon and it has reverted back to a dropdown menu for the states
It depends on the country selected. If a country has states, then the drop-down menu will be shown. Otherwise Ecwid will show the input box.


Thank you for sharing the solution! It is very appreciated.
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #7  
Old 06-09-2010, 03:20 PM
Gene B's Avatar
Gene B Gene B is offline
Junior Member
 
Join Date: May 2010
Posts: 1
Default Changing state to "county"

Hi,

I would like to be able to show "County" instead of "State" as we don't have states in the UK.

Is it possible to change just the label?
  #8  
Old 06-09-2010, 03:30 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by Gene B View Post
Hi,

I would like to be able to show "County" instead of "State" as we don't have states in the UK.

Is it possible to change just the label?
Yes: http://kb.ecwid.com/How-do-I-change-...-in-storefront
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #9  
Old 09-24-2010, 08:17 AM
slice's Avatar
slice slice is offline
 
Join Date: Dec 2009
Posts: 697
Default

How do we fix the list of 'States' for the United Kingdom?

I notice that the UK is set up with some rather strange 'states' such as 'Redbridge' which is actually a London Borough rather than a postal region but is missing counties such as 'Berkshire' where Windsor Castle is.

Of course counties are rather arbitrary and the Post Office doesn't any longer include counties in its PAF database so it is tempting to get rid of the lot of them but I believe they are still used by some couriers, So if we have to have them how is it possible to correct these? I have tried to add Berkshire but nothing happens.

On a similar issue I think the address form should start with country as at the moment we have the strange situation of choosing a state before we have selected the country so we potentially get a dropdown list of all the states in the world.

Just spotted another missing entry - Isle of Man.

Actually for the UK it would imho be better to have a field where customers where can enter there own county if they so wish.

Last edited by slice; 09-24-2010 at 08:29 AM. Reason: ADDITIONAL INFO
  #10  
Old 09-24-2010, 12:00 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by slice View Post
How do we fix the list of 'States' for the United Kingdom?

I notice that the UK is set up with some rather strange 'states' such as 'Redbridge' which is actually a London Borough rather than a postal region but is missing counties such as 'Berkshire' where Windsor Castle is.

Of course counties are rather arbitrary and the Post Office doesn't any longer include counties in its PAF database so it is tempting to get rid of the lot of them but I believe they are still used by some couriers, So if we have to have them how is it possible to correct these? I have tried to add Berkshire but nothing happens.

On a similar issue I think the address form should start with country as at the moment we have the strange situation of choosing a state before we have selected the country so we potentially get a dropdown list of all the states in the world.

Just spotted another missing entry - Isle of Man.

Actually for the UK it would imho be better to have a field where customers where can enter there own county if they so wish.
1. In order to correct the list of counties, please report a new ticket to our bug-tracker.
However I should note, that there is no official list of counties and everybody has his/her own list of "correct" counties.

Maybe you're right and we should remove the pre-defined list.

2.
Quote:
On a similar issue I think the address form should start with country as at the moment we have the strange situation of choosing a state before we have selected the country so we potentially get a dropdown list of all the states in the world.
We've already discussed this with our team. Actually, it isn't an issue, because:

- in most cases you don't need to select the country manually. We set it automatically on the basis of your IP.
- the current field order is more usual for a customer. Check Amazon, for example.
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:56 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.