How to Completely Block Off OpenCart with Maintenance Mode

  • SumoMe

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.

  1. In your Administration Panel, navigate to System > Settings.
  2. Click Edit on the corresponding store you are working on.
  3. Click the Server tab.
  4. Switch Maintenance Mode to Yes and Save.

Second: Create a blank template file for Maintenance Mode.

  1. 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.
  2. 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.

Image by phre3a 

About maca

Hello, my name is Karlo Macariola. I once dreamed to be a painter or an animator but when I typed my first line of code I immediately fell in love with programming. Today my passions are with web development and web design though sometimes I still withdraw to my first love which is drawing. DeviantArt | Twitter | Facebook
This entry was posted in Web Development & Design and tagged , , . Bookmark the permalink.

5 Responses to How to Completely Block Off OpenCart with Maintenance Mode

  1. Zoe says:

    Perfect – thank you; this is exactly what I needed for a client 🙂

  2. Jermaine says:

    You can leave

    in maintenance.tpl to leave the maintenance message itself.

    Added in case of html parsing issues:
    <div id=”content”><?php echo $message; ?></div>

  3. Kat says:

    Just wanted to thank you for the above instructions. I used them months ago when doing the initial install, and again today when (for unknown reasons) the maintenance tpl and php reverted back to showing the header/footer. Wishing you all the best.

  4. Emer says:

    Really useful, thanks a mil !:)

  5. Mac says:

    In case you wish do switch maintenance mode via Database

    Edit Table ###_setting table of your opencart installation
    Find a row where “config_maintenance” is written and change its value from 0 to 1

    Then you may alter the Files as mentioned in the blog to change the Output of the Maintenance Screen

    Regards

Leave a Reply to Kat Cancel reply

Your email address will not be published. Required fields are marked *