Auto-updating modules

Since PrestaShop 1.5, it possible to have your module auto-update: once a new version is available on Addons, PrestaShop suggests an "Update it!" button to the user. Clicking this button will trigger a series of methods, each leading closer to the latest version of your module.

In order to bring auto-update support to your module, you need three main things:

For instance:

/*
* File: /upgrade/Upgrade-1.1.php
*/
function upgrade_module_1_1($module) {
  // Process Module upgrade to 1.1
  // ....
  return true; // Return true if succes.
}

...and then:

/*
* File: /upgrade/Upgrade-1.2.php
*/
function upgrade_module_1_2($module) {
  // Process Module upgrade to 1.2
  // ....
  return true; // Return true if succes.
}

Each method should bring the necessary changes to the module's files and database data in order to reach the latest version. PrestaShop will then parse all of these scripts one after the other, sequentially.

It is therefore highly advised to number your module's versions sequentially, and using only number.