I've create my first plugin for prestashop. I want to add autoupdate functionality for autoupdate as do for example eBay module.
I did not found anything about that on documentation.
I've been struggeling to figure out the correct process for this for a while. I thought the "upgrade it" button was only available for developers, who release their modules through the prestashop addons website (which is true) but if you chose not to publish there, here's how you update your own modules:
In the main file of your model, within the contructor method, you must have this line of code:
$this->version = '1.0.0';
upgrade
install-1.0.1.php
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_0_1($object, $install = false)
{
//your code here, for example changes to the DB...
return true; //if there were no errors
}
?>
$this->version = '1.0.1';
Now you should see 2 messages:
The module was successfully downloaded.
and
The following module(s) were upgraded successfully:
MyModule :
Current version: 1.0.1
1 file upgrade applied
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With