Ocmod not working in opencart frontend

Posted by Flo on 09 Apr 2016

People had this issue so many times I thought I would write a bit about it.

The  types of issues with opencart's 2.x modification system that I identified so far are:

1. Old Vqmod version installed which doesnt support ocmod

2. Ocmod cache could not be written due to insufficient folder permission

3. The ocmod cache doesnt get loaded in frontend (ocmod works in admin but not in frontend)

The most common I encountered is number 3 because it has to do with the opecart installation method.

Some control panel software installers do not properly configure the opencart root config.php file.

If you are just beginig with ocmod, and install your first modification but nothing happens after you refreshed the ocmod cache, you should first check the problems 2 and 3.

For problem number 2: After you are certain that you refreshed the ocmod cache, log in to your store's root via a ftp client and check if in the folder system/modification (in opencart 2.0.x) or system/storage/modification (for opencart 2.1+) you find a bunch of other folders like admin and catalog. If you do, then this is not the issue, if you dont, then you might have permission problems so you should check your error logs.

For problem no 3: Log into your store's root via a ftp client and open the root config.php in your text editor of choice. If the root config.php contains a constant DIR_CATALOG then this is a problem. You must take the value from DIR_CATALOG, assign it directly to DIR_APPLICATION and then delete the DIR_CATALOG line. After this, ocmod should work fine for frontend as well. On the other hand, if you do not find that constant in the root config then you dont have this problem, do not worry about the one from the admin/config.php, that one is supposed to be there.

If you upgraded you opencart version from 1.5 to 2.x, make sure to also upgrade your vqmod version so that you dont run into problem no 1.