A country by default selected on the address form (checkout Step 2)

Hi,

Is there an easy way to have a country by default selected in checkout Step 2? (choose country - dropdown!)

At the moment “-” is select.

Any tips? I tried to change the order of the countries in the database but no luck ( which is maybe a bug?) )-:

The relevant php code of the user.tpl (Step 2) is:

<select name=“invadr[oxuser__oxcountryid]”>

<option value="">-</option>

[{foreach from=$oView->getCountryList() item=country key=country_id}]

<option value="[{$country->oxcountry__oxid->value}]"[{ if $oxcmp_user->oxuser__oxcountryid->value == $country->oxcountry__oxid->value }] selected[{elseif $invadr.oxuser__oxcountryid == $country->oxcountry__oxid->value}] selected[{/if}]>[{$country->oxcountry__oxtitle->value}]</option>

[{/foreach}]

</select>

Any help would be really appreciated.

Martin

Hi Martin,

a quick shot but try this out:

<option value="">U.K.</option>

__________________ Marco Steinhäuser Community Guide OXID eSales AG

Thanks Marco.

But i think i need to pass on the “countryid” and not just the name.

I tried to re-arrange the main country in the admin area under countries -> sorting

so it would appear in the first position in the drop down (and getting rid of “<option value=”">-</option>") But unfortunately the “sorting” of the countries has no effect (bug?)

The countries are listed alphabetically whatever you do.

MArtin

https://bugs.oxid-esales.com/view.php?id=697

:wink:


Marco Steinhäuser
Community Guide
OXID eSales AG

cool thanks

Any temporary solution for me?

Many thanks,

MArtin

Well, I would try the above mentioned (option value) out. Maybe it works perfectly (not tried).


Marco Steinhäuser
Community Guide
OXID eSales AG