langziyang Posted March 2, 2015 Share Posted March 2, 2015 (edited) hi,i have a module on addos. $this->version='1.0.0'. frist version i have not create an /upgrade sub-folder in the module's folder. now i fix some code on uninstall() function: add this code: !Configuration::deleteByName('ET_ALIPAY_SERVER') || and add this code on getContent() function : Configuration::updateValue('ET_ALIPAY_SERVER', Tools::getValue('service')); and set the $this->version='1.0.1'; now i create an /upgrade sub-folder in the module's folder.create install-1.0.0.php file; put the code: if (!defined(_PS_VERSION_)) exit; function upgrade_module_1_0_1($object) { return true; } so in my think, the auto upgrade function is done?i just update the module on addons,then other website will show an "Update it!" button to the user? Edited March 3, 2015 by langziyang (see edit history) Link to comment Share on other sites More sharing options...
langziyang Posted March 3, 2015 Author Share Posted March 3, 2015 hello? Link to comment Share on other sites More sharing options...
Tuni-Soft Posted March 3, 2015 Share Posted March 3, 2015 The file name is wrong I think It should be renamed to "Upgrade-1.0.1.php" http://doc.prestashop.com/display/PS15/Auto-updating+modules Link to comment Share on other sites More sharing options...
bellini13 Posted March 3, 2015 Share Posted March 3, 2015 there is no reason to create the upgrade file, unless you need to perform an action during the upgrade. Sometimes modules need to register new hooks, or create/alter/delete a database table. This is where you would implement an upgrade file. Otherwise it is not necessary. Modules also do not auto-update. The merchant would have to either install the new module version, or detect that a new version of your module is available on the addons store. That requires the merchant to log into their addons account from the back office. Not something all merchants do. Link to comment Share on other sites More sharing options...
langziyang Posted March 4, 2015 Author Share Posted March 4, 2015 there is no reason to create the upgrade file, unless you need to perform an action during the upgrade. Sometimes modules need to register new hooks, or create/alter/delete a database table. This is where you would implement an upgrade file. Otherwise it is not necessary. Modules also do not auto-update. The merchant would have to either install the new module version, or detect that a new version of your module is available on the addons store. That requires the merchant to log into their addons account from the back office. Not something all merchants do. so you mean is if i edit the .tpl or .js,.css and .php,any file i need. but not need register new hooks or edit database.i just set $this->version='new version'. and i upload my module on addons, then PrestaShop suggests an "Update it!" button to the user. and the user click the "Update it" button will download the new version file? Link to comment Share on other sites More sharing options...
bellini13 Posted March 4, 2015 Share Posted March 4, 2015 then PrestaShop suggests an "Update it!" button to the user. and the user click the "Update it" button will download the new version file? if the user purchased your module, and they are logged into the addons store from their back office, then yes. the only way to be sure is for you to try it. if it doesn't work, then report the issue to the addons team. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now