module - How add auto update functionality to prestashop plugin -
i've create first plugin prestashop. want add autoupdate functionality autoupdate example ebay module.
i did not found on documentation.
i've been struggeling figure out correct process while. thought "upgrade it" button available developers, release modules through prestashop addons website (which true) if chose not publish there, here's how update own modules:
in main file of model, within contructor method, must have line of code:
$this->version = '1.0.0';
- make subdirectory in module folder called
upgrade
- create new file in directory called
install-1.0.1.php
- put code in file:
<?php if (!defined('_ps_version_')) exit; function upgrade_module_1_0_1($object, $install = false) { //your code here, example changes db... return true; //if there no errors } ?>
- in main file, change
$this->version = '1.0.1';
- create zip file of module folder
- navigate modules page on stores end, , "upload new module"
- upload zip file
now should see 2 messages:
the module downloaded.
and
the following module(s) upgraded successfully:
mymodule :
current version: 1.0.1
1 file upgrade applied
Comments
Post a Comment