A PrestaShop store that worked yesterday and today shows an error, a cart that no longer adds products or a missing payment button is often suffering from a conflict between modules. PrestaShop includes a tool built for exactly this situation, and a simple method lets you find the module at fault without tearing your store apart.
How a module ends up in conflict
A module adds code that runs at specific moments while a page loads, called hooks. Two modules can change the same element, a module can replace a core class with an override, or an update can make it incompatible with your PrestaShop or PHP version. The symptom then shows up somewhere that sometimes has no obvious link with the faulty module.
Step 1, back up the store
Before you change anything, back up your files and database, through your host or with the tool you normally use. The next steps delete nothing, but a recent backup lets you go back whatever happens.
Step 2, disable all non-native modules
Open Advanced Parameters > Performance. The debug mode block contains an option that disables every module that is not part of PrestaShop in one go, and a second option that disables all class and controller overrides. Turn on the first one, save, then test the page that had the problem.
If the problem goes away, the cause is among your third-party modules. If it persists, turn on the override option as well and test again. If nothing changes with both options on, the problem is more likely in the theme, the server or the PrestaShop core.
Step 3, re-enable modules one at a time
The PrestaShop functional documentation describes the rest of the method. Set the option back to its normal value to get your modules back, then disable the third-party modules yourself from the module manager. Next, re-enable them one at a time, checking after each one that the store works properly before moving on to the next.
The module that brings the problem back is the one you are looking for. Start with the modules installed or updated most recently, since they are the most likely culprits.
Disabling a module keeps its settings, while uninstalling it can delete its data. For a diagnosis, always disable.
Step 4, if the back office is unreachable
When the error also blocks the admin panel, first turn on debug mode by setting _PS_MODE_DEV_ to true in /config/defines.inc.php. The message that appears often contains the path /modules/module-name/, which points to the faulty module with no searching at all.
To neutralize that module without the back office, temporarily rename its folder in /modules/ over FTP, for example to modulename_off. PrestaShop no longer finds it and stops running it. Restore the original name as soon as you have regained access, then disable the module properly from the module manager.
Never delete a module folder over FTP. The official PrestaShop documentation is firm on this point, because a manual deletion leaves the module's data and settings in the database without going through the proper uninstall process.
Step 5, once you have found the module
First check whether an update for the module exists, then confirm that its product page lists compatibility with your PrestaShop and PHP versions. If the module is up to date and compatible, contact its developer with your PrestaShop version, your PHP version and the error message you got in debug mode. To give the developer access to the store, create a dedicated employee account that you disable when the work is done, as PrestaShop recommends, and never share your own login details.
Frequently asked questions
Can PrestaShop's native modules be the cause?
It is less common, because they are tested with each PrestaShop release. That is why the diagnostic tool only disables third-party modules.
Does disabling all non-native modules affect my customers?
Yes. During the test, the features those modules provide disappear from the store, including payment if your payment module comes from a third party. Run the test outside busy hours or turn on maintenance mode first.
What is an override?
An override is a file placed in the /override/ folder that replaces part of the PrestaShop code. It is often installed by a module, and two overrides that change the same class can conflict with each other.
Too many modules to test one by one, or the developer no longer replies? We can identify the conflicting module and fix the incompatibility. The diagnosis is free and you receive an estimate before you buy anything.
Comments
Be the first to comment on this article.