Jump to content

how to set my Module auto-update


langziyang

Recommended Posts

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 by langziyang (see edit history)
Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...