Removing checkout fields in OpenCart

Note: This guide was written for OpenCart 1.x. Although the process is similar for OpenCart 2.x and 3.x, the actual code will differ from the one in this guide.

By default OpenCart asks your customers to specify a number of personal information and address fields during checkout. While this is suitable for most stores, sometimes you might want to simplify the checkout process by removing some fields from the checkout page.

The easiest way to do it is hide input fields and remove error checks. I'll use OpenCart as a basis, but this should be similar for all 1.5.x versions. We recommend you only modify OpenCart core files through vQmod or OCMOD.

Step 1: Modifying the template

There are two main templates responsible for input fields during checkout in default OpenCart theme: catalog/view/theme/default/template/checkout/register.tpl for account registration and catalog/view/theme/default/template/checkout/guest.tpl for guest checkout. Both of the files follow a similar structure so the process for modifying guest checkout template will be the same as for new user registration.

There are also two possible ways of introducing modifications: either by changing the original templates (directly or with vQmod) or by modifying copies of templates and then pointing the controller to load your new files. I'll describe the second method since it reduces the number of core modifications which in turn will make it easier to upgrade later on. You can also change the original templates if you wish - the process will be the same.

First, let's copy our original template: catalog/view/theme/default/template/checkout/register.tpl to catalog/view/theme/default/template/checkout/register-new.tpl.

This alone won't make OpenCart use our new template, we also need to tell the controller to use it instead of the original. In catalog/controller/checkout/register.php, find the following lines (145 - 149):

Change register.tpl to register-new.tpl to tell the controller to load your new template. If you are using a custom theme, make sure you have the new file in your theme's folder.

Now you should be able to see the changes you make to register-new.tpl on the checkout page when selecting to create a new account. Let's make the changes!

We need to hide the input fields we don't want to be displayed by applying style="display:none" to them and removing the corresponding labels. Let's say we don't need Telephone, Fax, Company and Postcode fields.

First we remove the following lines of code from register-new.tpl:

Now we need to hide the input fields by applying style="display:none":

You can also remove the input fields instead of hiding them, however, you'll need to make sure they don't get accessed in the controller or you'll get a bunch of "Undefined index" notices later.

If you now refresh the page, you'll see that the input fields are gone (remove unnecessary line breaks to align the fields properly). However, the new checkout won't work yet. We now have to make appropriate changes in the controller to remove unnecessary validation of hidden fields.

Step 2: Modifying the controller

Controllers reponsible for checkout screen validation are catalog/controller/checkout/register.php for account registration and catalog/controller/checkout/guest.php for guest checkout. As with templates, they have a similar structure so I'll only describe modification of the first one.

All input form validation begins on line 18, when a post request gets submitted to the controller. Since Company and Fax are not mandatory inputs, we will comment out error checks for the rest of our fields: Telephone and Postcode. You can either comment out whole blocks or just the lines where the error variables get set.

Basically, this is it: our input fields are hidden, so empty values will get passed to the controller. However, since HTML forms can be altered on client side, we want to be sure no one tries to post any values for our removed input fields from a modified form, so we'll explicitly clear post array values for both fields before the validation begins. If you removed the fields instead of hiding them, doing this will also ensure you don't get "Undefined index" notices:

Now we're done! Our customers don't have to enter their telephone number and postcode anymore and the company input field is removed from the form.

Need help? Hire us!

We offer a wide range of professional OpenCart & MultiMerch services. Find out more!

Martin is the founder of MultiMerch who has dedicated his life to building great products.

  • Roupe


  • Nightstar


    This is a very good how-to!! Thanks indeed~ I followed your instruction to do t hat, and I wanna to complete hide the Step 2 & Step 3 in registration & checkout... but seems doesn't work... maybe I do the wrong way, especially for the other fields, can you demonstrate how to hide the Step 2? Thanks!

  • affect

    You can't just remove them since the customer always needs to have an associated address. The easiest way to do it would be to hide Step 2 form using CSS or JavaScript, then assign random or predefined values to mandatory address fields and automatically submit the form when Step 2 is requested.

    We're using a similar approach for hiding Step 3 here:

    You can use this vQmod as a base and extend it so it hides both steps.

  • Xavier

    This doesn't work for guest.tpl and guest.php. It generates a json.parse error. And if i use vqmod, it does not proceed to Delivery Options. Please Help!!

  • Martin Boze

    This process isn't exactly the same for guest accounts, it's similar though, you'll need to tweak it a bit yourself. To debug json.parse errors, use our tutorial to find out the actual server-side error here:

  • Ahmed

    Hi guys. There is also an alternative easier way to solve this problem. You can just remove the part that makes the Postal Code required and but in to quotes to make it a comment in both the register.tpl and the guest.tpl.

    I simply modified the code like this <!--*--> that way it keeps the postal code if any customer wants to voluntary include it and it avoids touching the basic structure of the file so as not to mess anything up while making it non-required.

    I hope this helps. Thanks

  • Akash

    since i am operating in only one city..i do not require options country, city, region. Through your steps i could definitely remove them. no doubt it worked.
    but, after filling the details when a customer clicks on CONTINUE button ..he is not getting redirected.. what should i do?

    • Iván

      Hi Akash, remember that if you hide or remove a required field, it will fail with the validation, you should disable/remove the validation for each field you remove.

      Thank you for this tutorial.

  • raj

    hey bro,

    First I have to say thanks for your great tutorial. I'am not getting the " Step 03 Delivery Details" and "Step 04 Delivery Method" section . It goes straight away to 05 Payment Methods. What is the issue ? I did some modifications to fields and i thought, its due to that issue but when i checked with a previous copy of mine it comes up with same issue step 03 and 04 are missing. Its frustrating me. Is it due to some issue with jqurey files ?

  • it does not help :(

  • i've used this method and i thought everything worked properly. But when a costumer orders and gets a confirmation e-mail from his adress and from the products there is a error.

    Instead of a gap or just nothing is this wat they see:

    Notice: Undefined variable: address_2 in /home/rovaranl/domains/

    This looks very strange and gives my shop a unprofessional look and feel.

    Can you tell me how to erase this error?

    Kind regards!


  • Can you please help me?

  • Pingback: Remove Checkout Fields | Open Cart Know How()

  • Pingback: Velden wijzigen/verwijderen in checkout | Open Cart Know How()

  • Pingback: Uitschakelen van functie required telephone | Open Cart Know How()

  • Pingback: Bevestig-uw-bestelling-knop moet 2x (!) ingedrukt worden | Open Cart Know How()

  • I have tried to follow the notes here and have successfully removed the fax, company, company ID and Tax ID fields, However, when I get to "Delivery method" I get the message "Warning: No Shipping options are available. ". These were available before. I have tried to undo the steps above, but cannot remove the error message - can you advise me on how to reinstate shipping options after the above code changes?

    Thanks, Sarah

  • Pingback: afrekenformulier verplichte personalia veranderen | Open Cart Know How()

  • Pingback: Unidentified Index / How to read Error.log | Open Cart Know How()

  • Hello,
    all i want to do is change FAX in the checkout page,
    How can i do this please?

  • A load of thanks to you. If you have a bitcoin address to make a donation, Im happy to do so.

    • affect

      We are happy to accept Bitcoin donations at 15ZV9XTqWWorPzG1k5DqryYkiM8rCuvtwm :)

  • Jasper

    Do you happen to know how to do this on 1.5.5? Because this doesn't seem to be working anymore. :(

    • Hey Jasper,
      Did you get these instructions to work in ?? Im installing on a new website and need to remove some fields. It did work perfectly in,
      see ya

  • which version of opencart is that? and I need same vqmod version to this file work?


    I have

  • Bob

    I think that the best way to do so is to install the extension Custom Registration:

    So you have the full control of all fields, that can be displayed or removed and also can be set to be required or optional. It works on Opencart but also on Mijoshop (Opencart+Joomla).

    Is not a free extension but it saved me a lot of time, and plus, it is compatible with all the latest versions of Opencart. It comes in two versions, one is for vQmod and the second (which contains the same features) doesn't require vQmod at all. It also allows you to style the registration forms with your own CSS and add your own javascript code to the registration/checkout pages. Very useful if you need some jQuery funcion to be added to the forms ( I use a small jQuery function together with that extension that highlights fields when the mouse hovers on them).

  • Normally I do not read post on blogs, however I would like to say that this write-up very compelled me to take a look at and do so! Your writing taste has been amazed me. Thank you, quite nice post.

  • Marko

    Thanks for the great tutorial! I have applied this for several fields (company id, fax, zone id...) in checkout process. The problem I have is that the checkout process is slower (loading time) than it used to be. Should this be normal?


  • It's realy dificult brother..!! I am sorry it just a suggest for to remove this post and replace with this.

    If you want to remove company name field:
    Open: /catalog/view/theme/your_template/template/checkout/guest.tpl
    And find this code:

    <input type="text" name="company" value="" class="large-field" />

    And then, replace with this code:

    <input type="text" name="company" value="" class="large-field" />

    1. You can change (entry_company) to (entry_address_2) or another
    2. You can change (name=company) to (name=address_2) or another
    3. You can change ($company;) to ($address_2;) or another
    4. It's easy and 100% works..!! But, don't forget to stay backup your default guest.tpl

  • If you are going for finest contents like I do, simply visit this web
    page every day for the reason that it presents quality contents, thanks

  • I try this with OC and not working :(

  • thanks for the tut. this fixed my issue with my eshop

  • My whole checkout page got screwed up trying to follow these instructions. It would be my mistake. But pls dont try these things if you are a novice.

  • Svemir

    Hi, this is great guide! Trough some errors and trials i managed to remove all fields except email. If i remove email field i don't get any notifications if something is ordered. Customer still gets they email.

    Do you have any suggestion where to look and what might need change? I am trying to understand, notification emails are sent by the store admin and not by the user and i still don't getem?

  • go to this location
    there you remove the taxid and company id
    for the registration page

  • Thanks a lot! "Undefined index" error confused me. Your post helped so much!

  • I am not sure where you are getting your information, but good topic.
    I needs to spend some time learning much more or understanding more.
    Thanks for excellent information I was looking for this information for my

  • I read a lot of interesting posts here. Probably you spend a lot
    of time writing, i know how to save you a lot of time, there is an online tool that creates unique, SEO friendly posts in minutes, just type in google - laranitas free content

  • pezastic

    This article is a few years old. I wonder if the process is the same for OpenCart 2.

  • Catalin Teodorescu

    Hello, If i dont want to have mandatory field on guest checkout ... and someone doesnt type email address, how should i do to get email with order as Owner of shop ?

    • You should still receive the email as the store owner as long as your modifications are correct.