OpenCart 2.x checkout page asks the customers to fill up several details and address information during the checkout process. However, sometimes, to simplify the checkout process, we wish to remove some fields from the checkout page that we think are not important to us. As these fields might be unnecessarily making the checkout complex and lengthy. So, in this article, I will discuss how to remove unwanted fields from the OpenCart2.x checkout page. Moreover, I’ll use the OpenCart version 2.x to explain how can you remove such fields from the Guest and registered checkout process.
As an example, I will remove the “Fax” field from the guest checkout and Register Account. Also, you can use the same approach to remove any other field too.
The codes for input field in checkout are handled by two main OpenCart templates:
catalog/view/theme/themeXXX/template/checkout/register.tpl – for Register Account
catalog/view/theme/themeXXX/template/checkout/guest.tpl – for Guest Checkout
PS: I would suggest you not edit these files directly. First, take a backup of the original files first by copying these files from your web server or wherever they are located. Next, keep them with you so that you can always revert in case of any mistake. Then, take another copy of these same files and perform the editing on these files, later replacing them with the original files on the site after editing.
Recommended Read: OpenCart Checkout Extensions to Drive Sales and Conversions for your store
Removing the Guest checkout fields
1. We will start with editing the Guest Checkout fields. So, the first step you need to follow here is to navigate to the following file directory and open the file:
catalog/view/theme/themeXXX/template/checkout/guest.tpl
2. We are removing the Fax field from the guest checkout here. So, find the following lines of code in the file you have just opened:
3. Remove this code from the file or you can also just comment on it to disable the code.
4. Next, we need to edit the controller file to make sure this removal will not show any “Undefined index” later. So, navigate to the following file directory and open the file to edit the controller:
catalog/controller/checkout/guest.php
Recommended Read: What to look out for in an engaging OpenCart checkout extension?
5. Look for the following lines of code in the files you have just opened:
$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'];
6. Remove the codes or you can just comment on them too.
7. Save both the files and replace them with the original files on the site.
Removing Fields from Register Account form
8. To remove the Fax field, open the following file :
catalog/view/theme/themeXXX/template/checkout/register.tpl
9. Find and remove the following lines of code in the file you have just opened
10. Next, we need to edit the following controller to make sure no “Undefined index” error is shown in the later part.
catalog/controller/checkout/register.php
11. Find the following line of code and remove it. You can also comment on it instead.
12. Save both the files now, and replace them with original files on the site.
So, this is how you can remove a field like “Fax” from both the Guest checkout and Account Register form. Moreover, you can follow a similar approach to remove any kind of field from the OpenCart checkout. Also, just do not forget to keep the backup of the original files before you edit them.
Recommended Read: Provide a Relaxing Online Shopping Experience to your Customers with this Opencart One Page Checkout Extension
Alternate solution
Editing the core files is not a recommended way to perform the changes on your OpenCart 2.x site. Some of us might suggest the use of vQmod or OCMOD to reduce the risk, but these methods are too complicated for website owners with no or less technical knowledge.
As an alternate solution, you can choose to switch to our OpenCart One Page checkout extension which is even compatible with OpenCart 2.x. It is a one-page checkout extension that removes the unnecessary elements from OpenCart 2.x and has loads of features to make your checkout conversion friendly.
How does the OpenCart One Page Checkout plugin work?
The One Page checkout extension for OpenCart replaces the multi-step checkout option with a single-page checkout. Since without getting you into the fuzzy the code changes it incorporates all the features that an optimized checkout page is expected to have. So, all you need to do is to install the OpenCart v2.x One Page Checkout module in your store. Moreover, the configuration changes are done at a few button clicks from the back-end and the changes will be reflected in the front end of your site.
Listed below are some of how the OpenCart Single Page checkout can help you remove unwanted elements:
Squeezes everything on one page
Instead of going with multiple checkout steps, the OpenCart One Page Checkout extension squeezes all the processes on a single page. With the reduction in the number of web pages, the code of the site becomes simpler.
No-code customization
You can “Hide” or “Display” any of the fields from the checkout page by simply changing the settings from the extension’s backend configuration. Plus you can change the orders of fields by just dragging and dropping. Along with this, the OpenCart one-page checkout module for versions 2.x and 1.x offers an additional comment section that can be removed at a button click if required.
Most of the store owners do not have the technical knowledge to code and make field configurations. This Opencart module brings great ease to them in setting up the checkout page layout as they require for their site. The number of fields and their position over the checkout page is fully customizable from the back office.
Guest checkout option
Without making any code changes, the OpenCart One Page Checkout module for v2.x enables the guest checkout option on the site. Not just this, you need not make any code changes as mentioned above if want to remove the guest checkout at any point. This can be done just by toggling a single button from the back-end of the OpenCart single-page checkout plugin.
You can even register those customers who do guest checkout at your store. Additionally, you can allow your customers to set their passwords while performing guest checkout.
Recommended Read: Plugins that can be a Good Combo Offer for One Page Checkout for OpenCart Stores
Social login option
You need not integrate the social signup options via coding. The OpenCart One Page checkout plugin comes with built-in social login options. You get Facebook and Google login options. All you need to do is to obtain the API details and share them in the back-end of the OpenCart plugin.
Multi-lingual support
If the site contents are displayed in multiple languages for different locations, then, some extra coding is required to be done. The OpenCart One Page checkout extension eases out this aspect for you. The extension offers multi-lingual support and the admin can upload the contents of the sites in as many languages as they wish. The respective contents are uploaded in one go without getting you indulged in any site changes.
Set Default Options
Most of the websites provide customers with the default option of “Login” considering that the user already has their account on the store. Likewise, you can also mark default options out from “Register”, “Login” or “Guest”.
Customizable Fields
The fields provided to the customer on the shipping and payment page are fully customizable from the backend panel.
Recommended Read: OpenCart One Page Checkout to Deliver a Perfect Online Shopping Experience
Concluding Words
In the customer-centric environment, a flawless user experience is key to staying ahead of the competition. One of the ways to do so is to keep everything precise and as combat as possible. So, this is when a single-step checkout process can help you out without getting you into the complication of code optimization. To increase the profitability of their business, every store owner wants to give their customers a simple and quick shopping experience.
Since the Page Checkout module lessens the clients’ additional work. Hence, Checkout became the focal point of this procedure. So, One Page Checkout Addon is a remedy for this problem as a result. In addition to OpenCart One Page Checkout Extension, Knowband offers a One Page Checkout Module for other platforms like PrestaShop and Magento 2. Thus, it enables the store admin to finish the checkout process on a single page, lowering the rate of cart abandonment.