Create nationality dropdown as custom address attriubte


Create nationality dropdown as custom address attriubte and display it on shipping and billing on onepage checkout.

Download Module

Just download the module and install it.Then after you have to write some code for display nationality select box on billing and shipping step.

Open your billing and shipping phtml and write below code.

<div class="field">
                    <?php $countryList = Mage::getModel('adminhtml/system_config_source_country')->toOptionArray();
                    ?>
                        <label for="billing:nationality" class="required"><em>*</em><?php echo $this->__('Nationality') ?></label>
                        <div class="input-box">
                            <?php if (count($countryList) > 0): ?>  
							<select name="billing[nationality]" class="validate-select"  id="billing:nationality">  
							<?php foreach($countryList as $_country): ?>  
							<option value="<?php echo $_country['value'] ?>">  
							<?php echo $_country['label'] ?>  
							</option>  
							<?php endforeach; ?>  
							</select>  
							<?php endif; ?>
                        </div>
                    </div>

Next I made some changes to the address templates in Magento Admin. Go to System→Configurations→Customers→Customer Configurations→Address Templates

and add nationality same like country field.

Billing

Billing

Enjoy Codding 🙂