Categories

Featured templates

OpenCart 2.x. How to remove fields from checkout process

Ray Taylor June 30, 2015
Rating: 3.8. From 4 votes.
Please wait...

In this tutorial you will learn how to remove checkout fields in OpenCart.

OpenCart 2.x. How to remove fields from checkout process

By default, OpenCart requires your customers to specify some personal information and address fields while checkout. However, sometimes we might want to simplify the checkout process by removing some fields from the checkout page.

  1. In this example we will show you how to remove the Fax field from Guest Checkout and Register Account.

  2. There are two main templates responsible for input fields during checkout in OpenCart template(s): catalog/view/theme/themeXXX/template/checkout/register.tpl for Register Account and catalog/view/theme/themeXXX/template/checkout/guest.tpl for Guest Checkout. Both of the files follow a similar structure, so the process of modifying guest checkout template and the new user registration template will be similar:

    open_cart_2_remove_checkout_fields-01

  3. Let’s start from editing Guest Checkout fields. Connect to your server using FTP client or File Manager within your hosting cpanel.

  4. Open catalog/view/theme/themeXXX/template/checkout/guest.tpl file:

    open_cart_2_remove_checkout_fields-02

  5. In order to remove the Fax field, find the following code:

    <div class="form-group">
    			<label class="control-label" for="input-payment-fax"><?php echo $entry_fax; ?></label>
    			<input type="text" name="fax" value="<?php echo $fax; ?>" placeholder="<?php echo $entry_fax; ?>" id="input-payment-fax" class="form-control" />
    		</div>

    Remove this code or comment it out:

    open_cart_2_remove_checkout_fields-03

  6. Next file which we need to edit is catalog/controller/checkout/guest.php:

    open_cart_2_remove_checkout_fields-04

  7. Find the following code and remove it:

    $data['entry_fax'] = $this->language->get('entry_fax');
    		if (isset($this->session->data['guest']['fax'])) {
    			$data['fax'] = $this->session->data['guest']['fax'];
    			} else {
    			$data['fax'] = '';
    		}

    $this->session->data['guest']['fax'] = $this->request->post['fax'];
  8. Save both files and upload them to the server replacing the original files:

    open_cart_2_remove_checkout_fields-05

  9. Now let’s change the Register Account fields.

  10. Open catalog/view/theme/themeXXX/template/checkout/register.tpl file:

    open_cart_2_remove_checkout_fields-06

  11. In order to remove the Fax field, find the following code:

    <div class="form-group">
    			<label class="control-label" for="input-payment-fax"><?php echo $entry_fax; ?></label>
    			<input type="text" name="fax" value="" placeholder="<?php echo $entry_fax; ?>" id="input-payment-fax" class="form-control" />
    		</div>

    open_cart_2_remove_checkout_fields-07

  12. the next file which we need to edit is catalog/controller/checkout/register.php:

    open_cart_2_remove_checkout_fields-08

  13. Find the following code and remove it:

    $data['entry_fax'] = $this->language->get('entry_fax');

    open_cart_2_remove_checkout_fields-09

  14. Save both files and upload them to the server replacing the original files.

Thank you for reading this tutorial. Now you know how to remove checkout fields in OpenCart template(s).

Feel free to check the detailed video tutorial below:

OpenCart 2.x. How to remove fields from checkout process

OpenCart Templates
This entry was posted in OpenCart Tutorials and tagged checkout, field, opencart, process, remove. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket

  • Michael Nichols

    don’t forget to remove the “fax” code from line 14 of the catalog/model/account/customer.php file. If you forget to do this you/your customers will receive an error pop-up when clicking continue.

    No votes yet.
    Please wait...
Live Chat
We help you to choose the right product.