3

From the following files :

/app/design/frontend/base/default/template/customer/form/reg‌​ister.phtml /app/design/frontend/base/default/template/customer/form/add‌​ress.phtml /app/design/frontend/base/default/template/checkout/onepage/‌​billing.phtml and /app/design/frontend/base/default/template/checkout/onepage/‌​shipping.phtml

i did this trick converting php line

<?php echo $this->getCountryHtmlSelect() ?>

to html line

<select name="country_id" id="country" title="<?php echo $this->__('Country') ?>" class="validate-select">
    <option value="IN" selected="selected">India</option>
</select>

but not worked. In site showing one blank line and other line India.

I need only one line India or remove dropdown.

  • In which file did you make changes? – John Apr 27 '17 at 6:23
  • /app/design/frontend/base/default/template/customer/form/register.phtml /app/design/frontend/base/default/template/customer/form/address.phtml /app/design/frontend/base/default/template/checkout/onepage/billing.phtml and /app/design/frontend/base/default/template/checkout/onepage/shipping.phtml – Dipak Kumar Apr 27 '17 at 6:29
  • 1
    Which Magento version are you using? – Jaimin Sutariya Apr 27 '17 at 6:32
  • go to admin panel > system > configuration > general > countries option > allowed countries. – Teja Bhagavan Kollepara Apr 27 '17 at 6:39
  • i did by going admin panel process but not output changes. – Dipak Kumar Apr 27 '17 at 6:48
6

Its very simple
system > configuration > general > countries option > allowed countries. Just select the country you want. enter image description here

  • 1
    I did but still showing blank line and India in frontpage. – Dipak Kumar Apr 27 '17 at 8:13
  • @ Dipak Kumar: That is how it appears in default magento after the above configurations are set. You'll have to add some JS and CSS to set the selected country option as India and hide the dropdown. – Sukeshini Apr 27 '17 at 9:25
  • Tell me what code needs to add so that under Country Section only visible India and no drop down. – Dipak Kumar Apr 27 '17 at 10:01
  • Then select Default country just above that. It'll work for you – Divyansh Bajaj Apr 27 '17 at 10:52
  • not worked !!!! – Dipak Kumar Apr 27 '17 at 11:01
1

I think you are making changes to wrong files. Magento 1.9 comes with default RWD theme. So you will need to put your selectbox code in below files.

app\design\frontend\rwd\default\template\persistent\checkout\onepage\billing.phtml

<select name="billing[country_id]" id="billing:country_id" title="<?php echo $this->__('Country') ?>" class="validate-select">
    <option value="IN" selected="selected">India</option>
</select>

app\design\frontend\rwd\default\template\checkout\onepage\shipping.phtml

<select name="shipping[country_id]" id="shipping:country_id" title="<?php echo $this->__('Country') ?>" class="validate-select">
    <option value="IN" selected="selected">India</option>
</select>

app\design\frontend\rwd\default\template\customer\address\edit.phtml app\design\frontend\rwd\default\template\persistent\customer\form\register.phtml

<select name="country_id" id="country" title="<?php echo $this->__('Country') ?>" class="validate-select">
    <option value="IN" selected="selected">India</option>
</select>
  • still showing blank line and other India under Country Section in magento? – Dipak Kumar Apr 27 '17 at 9:59
  • Are you using any custom theme or third party checkout extension? Which browser you are using? – Jaimin Sutariya Apr 27 '17 at 10:02
  • I am using chrome browser. Magento ver. 1.9.2.1 – Dipak Kumar Apr 27 '17 at 10:06
  • is there any theme you are using? or using Magento's default theme? – Jaimin Sutariya Apr 27 '17 at 10:07
  • Magento default theme – Dipak Kumar Apr 27 '17 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.