Most of the problems that people have when using OpenCart; they create themselves with bad code changes, MODS / Extensions / Themes then blame the OpenCart... OpenCart will do dumb things if you put in dumb code. Talk about dumb and dumber... Don't get me wrong OpenCart has a few short comings but you have to be able to distinguish one from the other to fix the issue. Most of the real issues are with third party MODS / Themes / Extensions that have been installed or physical code changes. Here are some ways find out just where the real problems truly lies.
- DO NOT MODIFY OPENCART FILES DIRECTLY! Use VQMOD for OpenCart & VQMOD Manager for code changes. If you don't know how to use it LEARN!!! It can save real debugging troubles down the road and the changes can be removed easily. It also serves as an audit trail for code changes if you comment your code.I know commenting code is very old school but it should be done, it can help 6 months down the road when you yourself have no idea of what you were attempting to accomplish. YEAH YEAH, I know you remember everything!There are very common sense procedures that you should follow to debug your system and primarily not get into trouble in the first place.
- You should ONLY use MODS that have VQMOD XML files and do not replace ANY core OpenCart files. I recommend that you use VQMOD Manager along with VQMOD for OpenCart for best results.The VQMOD manager allows you to see if there are any structural errors in the XML files that you are about to install and if something searched for cannot be found deterring the code change which may render the code somewhat useless.
- When starting on a new, old or upgraded system (of any kind). You should test the system/function with no additional code or modifications to see how it work and reacts without any changes (all code removed).You do this to find out what works or does not work and what will need to be corrected. With OpenCart; remove all third party MODS / Themes / Extensions.This type of testing may render some of your MODS unnecessary because the errors may have been corrected or the needed functionality may now be present.
- Add the MODS / Themes / Extensions back into your system one by one then test their functionality to make sure that they still work as they are supposed to and have not created new problems.
If you find a problem you will know exactly what is causing the problem. Be careful to notice and check if MODS from one version are compatible with another. Do not trust the authors of these MODS / Themes / Extensions for most of these things; I have found that most of the authors do not test their code very well (if at all). Testing can take a long time; but you want a working systems with little or no problems, yes?
- Take the approach to not create problems where none should exist in the first place. Do not add anything to your system that you did not thoroughly test.
- This means that you need to keep a test system active, it is not that difficult.This is probably one of the most common mistakes users make by NOT having a test system and then operating directly on the live system. Why would you want to take down your live system with a MOD? Yet some people still do this... Even if you have an error on your live system, get it right on your test system BEFORE applying it on your live system so that you don't look so amateurish by applying a broken fix or taking the whole system down with a "fix".
- If you have an issue; make sure that when you do ask for help you give a full story on what may have caused the problem. This means everything that lead up to the problem for the problem did not just happen all by itself.
- This will allow others to help better. A good question gets good answers and therefore if you ask a poor question you get poor answers. No one can read your mind... Always give as much information as you can, even if you think it does not relate. It may help someone who may be a little more knowledgeable help you, use pictures if you have to.
In the event you are still having trouble; here is a module that can help you debug your OpenCart system - https://randemsystems.support/opencart/debug-trace-your-opencart-operations/
The very best way to debug php code is with a php debugger such as eclipse (https://www.eclipse.org/downloads/) combined with WampServer (https://www.wampserver.com/en/) and Xdebug (https://xdebug.org/). Learning how to use these packages will save you a huge amount of time.