One morning, I received an email from my boss instructing me to completely block off the company’s online store which was in its development stage. Apparently, switching it to Maintenance Mode was not enough. My boss didn’t want people to see the design of the website (because in Maintenance Mode the layout is still visible) while it was in development. In other words, she wanted it to be blanked out, like the white screen of death in WordPress.
To make up for the fact that what I did was actually pretty stupid (making it public while still in development and all…), I will show you my simple solution to completely blocking off your OpenCart installation from the public with Maintenance Mode.
First: Switch on Maintenance Mode.
- In your Administration Panel, navigate to System > Settings.
- Click Edit on the corresponding store you are working on.
- Click the Server tab.
- Switch Maintenance Mode to Yes and Save.
Second: Create a blank template file for Maintenance Mode.
- In your OpenCart installation’s root folder, navigate to catalog/view/theme/[yourtheme]/template/common/maintenance.tpl, where [yourtheme] is the theme you are currently using.
- Open this file and delete everything written in it and save. Also, you might want to create a backup of the original file in case you want to revert back. If maintenance.tpl doesn’t exist yet (probably because you are using a customized theme) then create a blank maintenance.tpl file in the said directory.
By now you should only see a blank screen when you log out of OpenCart and return to your website, so… tadaa! Somehow I am compelled to show you the expected result of this tutorial so here it is:
No magic there. Don’t worry because you can still see your website so long as you login (Yes, you can still access the login page). Also, knowing that maintenance.tpl is OpenCart’s maintenance page, you can do all sorts of stuff in there other than just blanking it out.