Your Shops Country pre-selected in the Countries List

By | August 11, 2008

This is a really easy change that should take you not more than 10 seconds to complete – and it will give your site visitors a better experience when creating an account.

We know that most stores sell to their own countrymen. USA stores tend to sell most to USA nationals, UK to UK, Ozzies to Ozzies and so on. So what we are going to do is put your country at the top of the “countries list” in the create_account page (and other pages).

You know that you set your stores country within your admin section:

And yet the country pulldown looks like this:

Pointless! Let’s make the country set in out Admin section…

Open up /includes/functions/html_output.php and find this:

[php]function tep_get_country_list($name, $selected = ”, $parameters = ”) {[/php]

Change it to this:

[php]function tep_get_country_list($name, $selected = STORE_COUNTRY, $parameters = ”) {[/php]

Save and upload. DONE! Now the country list looks like this when the page is refreshed:

And if you change the country to (say) Iceland as a test, then refresh the create_account.php page, Iceland will show pre-selected….

It’s a really simple change that will enhance your site and your visitors shopping experience.

3 thoughts on “Your Shops Country pre-selected in the Countries List

  1. Gary Post author

    Just made aware of a little problem with this code – if the person inserts their details but the create_account page is redirected back to itself due to something being wrong, the country they used will re-default back to STORE_COUNTRY. So that’s not so good. There’s always a work-around though, and I’ll find a solution and post it up.

  2. Gary Post author

    Piumini – hadn’t seen that one. I’ll test it out. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *