When the update button is not visible due to certain system checks, you can force the update of PrestaShop 1.6 by modifying two key files in the automatic update module. This guide will walk you through the necessary commands and modifications to accomplish this effectively.
Prerequisites
- Full Backup of Your Site: Before proceeding, it is essential to create a complete backup of your files and database.
- FTP or File Manager Access to Your Server: You will need access to the files on your server.
Files to Modify
The modifications will be made to the following files in the autoupgrade module:
UpgradeChecklist.php
UpgradeButtonBlock.php
These files are typically located under:
/modules/autoupgrade/classes/Twig/Block/
Commands and Modifications
- Modification of
UpgradeChecklist.php
Open theUpgradeChecklist.php
file. In this file, you typically won’t need to make substantial changes, but ensure that no condition is preventing the update button from appearing. You can search for variables or boolean conditions that might interfere and adjust them if necessary. - Modification of
UpgradeButtonBlock.php
Open theUpgradeButtonBlock.php
file. This file contains the essential logic for displaying the update button.
- Find and Modify the Following Condition: Look for the part of the code that determines whether the button is displayed. You will likely encounter a condition similar to this:
if ($this->selfCheck->isOkForUpgrade() && $versionCompare < 0) { $showUpgradeButton = true; }
- To force the update button to display, you can simplify this condition or make it always true:
$showUpgradeButton = true;
- Also, ensure that
$showUpgradeLink
is set to true:$showUpgradeLink = true;
This modification ensures that the update link is always visible, allowing users to initiate the update.
Publish and Test
After making the changes, save the files and upload them to your server. Then, access your PrestaShop admin panel and navigate to the automatic update module to check if the update button now appears as expected.
Feel free to contact me if you’re having trouble; we’ll find a solution together 🙂
See you soon on Tech To Geek!
"Because of the Google update, I, like many other blogs, lost a lot of traffic."
Join the Newsletter
Please, subscribe to get our latest content by email.