How to Force Update PrestaShop 1.6 Stuck on Autoupgrade

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

  1. Modification of UpgradeChecklist.php Open the UpgradeChecklist.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.
  2. Modification of UpgradeButtonBlock.php Open the UpgradeButtonBlock.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.

Mohamed SAKHRI
Mohamed SAKHRI

I'm the creator and editor-in-chief of Tech To Geek. Through this little blog, I share with you my passion for technology. I specialize in various operating systems such as Windows, Linux, macOS, and Android, focusing on providing practical and valuable guides.

Articles: 1643

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

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