Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Disable country option in registration form :: very urgent!!! 
 
Harry4
Member
 
Avatar
Total Posts:  44
Joined:  2009-02-14
India
 

Hello All,

I customized the registration form my self. In that form i dont require country option not even in shipping address. So how can i disable country option from the entire site. i have local cutomer chain in US so i dont need country option but need state/province option in text box.

Any body help please????? Its very urgent

 Signature 

Perfectoz cool hmm

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kara Heinrichs
Guru
 
Avatar
Total Posts:  482
Joined:  2008-01-17
aa, mi, us
 

If this is urgent, do a quick fix from the Admin side and then you can alter the PHTML file to match at your leisure. 

Do you have lots of countries showing up in the drop down list?  If you do, go to ADMIN> System> Configuration-General tab.  In the “Countries options” section make sure the default country is the US and then select only the US as an allowable country.  What this’ll do is remove all of the other country options from all of the country drop downs.  As long as US is set as the default country, that’ll be pre-populated and the customer won’t have to select it at least.  It’s not perfect, but it eliminates all the incorrect countries from showing up in the lists and buys you time maybe.

Then, to get rid of the country drop down completely, you have to find the spots where it’s located--checkout, account, edit billing address form, edit shipping address form and either comment it out or delete it from the PHTML file that controls that form.  In the one page checkout, the billing form is located at: app/design/frontend/yourInterface/yourTheme/template/checkout/onepage/billing.phtml.  Comment out the following code section:

<div class="input-box">
   <
label for="billing:country_id"><?php echo $this->__('Country'?> <span class="required">*</span></label><br />
    
<?php echo $this->getCountryHtmlSelect('billing'?>
</div>

You may have to mess around with the divs and lis a bit to keep the formatting right, but that’s the basic trick to it.

 Signature 

Founder and Principal at Brillig House, specializing in Magento consulting, training and theme design.

Check out mage-page.net for links to Magento blogs and current articles from around the web.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kara Heinrichs
Guru
 
Avatar
Total Posts:  482
Joined:  2008-01-17
aa, mi, us
 

I take it back on my advice to comment out that div with the country input field.  I walked away and remembered there’s some javascript field checking and drop-down creation on those forms that requires the country code.  You can probably assign the variable easily enough as well, but really quick and dirty, set the class on the input field to be “no-display” and it’ll hide the field but still pass the US as the country since it’s the default, and you should be all set.  Sorry about the bum steer.

Use this instead (add “no display” to the class):

<div class="input-box no-display">
    <
label for="billing:country_id"><?php echo $this->__('Country'?> <span class="required">*</span></label><br />
   
<?php echo $this->getCountryHtmlSelect('billing'?>
</div>

 Signature 

Founder and Principal at Brillig House, specializing in Magento consulting, training and theme design.

Check out mage-page.net for links to Magento blogs and current articles from around the web.

 
Magento Community Magento Community
Magento Community
Magento Community
 
todocono
Jr. Member
 
Total Posts:  4
Joined:  2009-06-23
 

hey, man.. thanks for the tips. And what about a solution to take me out of the “quick & dirty” state ?

Does somebody has an elegant solution to disable country option?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Harry4
Member
 
Avatar
Total Posts:  44
Joined:  2009-02-14
India
 

Great help Mate !!!!

 Signature 

Perfectoz cool hmm

 
Magento Community Magento Community
Magento Community
Magento Community
 
Abiral Shakya
Jr. Member
 
Total Posts:  5
Joined:  2010-09-05
 

I kinda have a different situation. I want all countries to show up in billing address but only a single country in shipping address. how do i do that. please help

 
Magento Community Magento Community
Magento Community
Magento Community
 
shiwak224
Member
 
Total Posts:  41
Joined:  2011-03-23
 

You can adjust everything from configuration panel, but for states i am not sure.. but countries can be managed from configuration panel in magento.

 Signature 

| klarinet | kitare

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
819302 users|745 users currently online|519714 forum posts