5

I want to remove zip/postal code and country from checkout page.

I removed them from billing.phtml file successfully. But when submit checkout data it shows alert that "country" and "zip/postal" code required.

I want to remove them from shipping.phtml file also.

  • your store is selling product for one country or multiple country ? – MeenakshiSundaram R Jun 23 '15 at 4:59
6
  1. Go to Configuration -> General -> Country Options
  2. Select only a single country (your default country)
  3. Select all country for the field Postal Code is Optional for the following countries.
  4. Update eav_attribute table and set is_required = 0 if attribute_code = 'postcode'
  5. You can remove the Zip/Postal Code fields on templates.
  6. Replace Country fields with this:

    <input type="hidden" name="country_id" value="<?php echo Mage::getStoreConfig('general/country/default'); ?>"/>
    
    <!-- Original Country Field
    <div class="field">
        <label for="billing:country_id" class="required"><em>*</em><?php /*echo $this->__('Country') */?></label>
        <div class="input-box">
            <?php /*echo $this->getCountryHtmlSelect('billing') */?>
         </div>
    </div>
    -->
    
  • i want to remove them from shipping page also .how ? – Mohamed Maree Jun 25 '15 at 12:48
  • As said on the steps, you would have to modify the templates. In your case, you would have to find what template is used on your shipping page, then follow the steps above. – Vernard Luz Jun 25 '15 at 13:42
  • You're welcome, Mohamed Maree – Vernard Luz Jun 25 '15 at 14:25
  • I want to removed only country..your code in removed country and state both.. – Magento2 Devloper Mar 3 '17 at 5:19
  • I think you can work on that just fine. Find the template and remove the HTML of state only, and leave the country. You're a developer, right? – Vernard Luz Mar 4 '17 at 13:46
0

For country option just put a style on it as display:none;

E.g. Note: This option is valid if you have selected by default country option from admin.

<div class="field" style="display:none;">
   <label for="billing:country_id" class="required"><em>*</em>
  <?php echo $this->__('Country') ?></label>
    <div class="input-box">
  <?php echo $this->getCountryHtmlSelect('billing') ?>
    </div>
</div>

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.