Knowledgebase

How to remove the company field from the checkout page in Magento

By default, at the billing and shipping address steps of the checkout process there's an optional field labeled Company. Although customers are not required to type anything in that field and can leave it empty, if you want to remove it you can do so by making a few minor changes to some of your Magento files.

Let's assume that your Magento is installed directly in the public_html directory on your Magento hosting account (meaning the frontend is accessible at yourdomain.com) and that you use the base theme that comes prepackaged with Magento.

First, edit the file billing.phtml which has a path of public_html/app/design/frontend/base/default/template/checkout/onepage/billing.phtml. Find and comment out the code (around line 44):

<div class="field">
<label for="billing:company"><?php echo $this->__('Company') ?></label>
<div class="input-box">
<input type="text" id="billing:company" name="billing[company]" 
value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" 
title="<?php echo $this->__('Company') ?>" class="input-text 
<?php echo $this->helper('customer/address')
->getAttributeValidationClass('company') ?>" />
</div>
</div>

To comment it out put an exclamation mark and two hyphens after the first bracket (e.g. <!--div) and two hyphens before the last bracket (e.g. /div-->). You can modify the file from the Files section of the Pixie control panel. A different way to do it is to download it on your local computer with an FTP client (e.g. FileZilla), edit it with a text editor (e.g. Notepad, Wordpad) and upload it back in the same folder overwriting the old file.

Then edit the file public_html/app/design/frontend/base/default/template/checkout/onepage/shipping.phtml and comment out the code (around line 43):

<div class="fields">
<label for="shipping:company"><?php echo $this->__('Company') ?></label>
<div class="input-box">
<input type="text" id="shipping:company" name="shipping[company]" 
value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" 
title="<?php echo $this->__('Company') ?>" class="input-text 
<?php echo $this->helper('customer/address')
->getAttributeValidationClass('company') ?>" 
onchange="shipping.setSameAsBilling(false);" />
</div>
</div>

The last thing is to edit another billing.phtml file; this one has the path public_html/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml. In that file comment out the code (around line 45):

<div class="field">
<label for="billing:company"><?php echo $this->__('Company') ?></label>
<div class="input-box">
<input type="text" id="billing:company" name="billing[company]" 
value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" 
title="<?php echo $this->__('Company') ?>" class="input-text <?php echo 
$this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
</div>
</div>

After you make these modifications refresh the checkout page on the frontend and check the result.

If in addition to this you also want to hide the company field that's on the add/edit address form of the customer account settings on the frontend, you have to make another modification. For more information read the article on removing the company field from the frontend customer account settings in Magento.

If you don't want to edit directly the files of the base theme (or of any other theme), you can create a child theme, change the default theme to the child theme and edit its files. For more details read the article on creating a subtheme in Magento.

Here are some more articles on removing fields from the checkout page:

Was this answer helpful?

 Print this Article

Also Read