Are you in an urge to build an attractive website with the best e-commerce features?
OpenCart would be one of the best choices for your online stores because of its customization options.
However, OpenCart header customization may causes errors due to the presence of other extensions or corrupted files.
At Bobcares, we often get requests from our customers to do the OpenCart customization as part of our Server Management Services.
Today, we’ll see how our Support Engineers do OpenCart header customization and fix related errors.
How we edit header in OpenCart
An OpenCart is one of the popular open-source eCommerce software used to build online stores. Also, both payment gateways and shipping methods are integrated into OpenCart as advanced options.
Most of the time, customers would like to have a customized look for their cart website.
Now, we’ll see how our Support Engineers edit an OpenCart template to change the default layout that is used for the OpenCart site.
Here, we use a cPanel control panel as an example.
1. Initially, we login into cPanel and use File Manager Code Editor to edit the code.
2. By default, all templates are located in folder /catalog/view/theme/default/template/ when we install OpenCart. So, we switch to /common directory located in /catalog/view/theme/default/template
3. Next, we right-click on the header.tpl file and select Code Edit.
4. After that, we make the necessary changes in it and click on Save Changes.
How we customize header in OpenCart
Similarly, many customers request us to customize their OpenCart sites to make their sites attractive,
Then we use the following steps to customize the header.
1. In “catalog/controller/common/header.php”, in the end, we can find the following block of code.
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/header.tpl';
} else {
$this->template = 'default/template/common/header.tpl';
}
And, we replace the above code with special code according to our client’s need.
Again, it is possible to implement custom website code with the help of web developers.
How we fixed related errors
Now, let’s see how our Support Engineers solved OpenCart header customization related errors.
1. Problems with extensions
Recently, one of our customers contacted us with a problem regarding his OpenCart template. He was doing header customization in the default template of Open Cart 2.1.0.2. However, changes in the header.tpl didn’t work and header.tpl still worked with no change and loaded the older header.
On checking, our Support Engineers found that he had installed OCMOD extension which modifies the header.tpl.
So, we navigated to Admin > Extensions > Modifications > click on the Refresh button to rebuild cache.
That’s solved the problem and loaded the new header on his site.
2. Corrupted files
Likewise, another customer had an error while customizing the header in OpenCart. The error said,
PHP Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/system/framework.php:#) in /home/username/public_html/catalog/controller/startup/session.php on line #
The major cause of this error is blank spaces present in the custom .php file.
So, our Support Engineers solved the issue by removing the extra spaces on the PHP file.
[Having difficulty in OpenCart header customization? We’ll fix it for you.]
Conclusion
In short, OpenCart is one of the PHP based online store management systems. Again, it’s very easy to customize an OpenCart header. Today, we saw how our Support Engineers made OpenCart header customization and fixed related errors.
0 Comments