If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

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

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