Jump to content

Updating a module


Recommended Posts

Hi everyone. I want to develop a system to compare the version of my module with the one already installed on presta. If this one is higher, I want to display an update pop-up to replace the old module with the new one. I specify, this is not an Addon module .... I found no doc ... Thanks have a good day.

Link to comment
Share on other sites

Whatever your module may be, distributed by addons.prestashop or not, if you have installed v.1.0.0 and you replace your module files with the respective v.1.0.1 ones, an upgrade button will be displayed next to your module.

This is the official procedure. If you want to track and log the updates instances, this is not covered by the core code.

  • Like 1
Link to comment
Share on other sites

Yeap. And inside files named [whatever]-[version separated with dots].php

So lets say upgrade-0.0.2.php

function upgrade_module_0_0_2(Module $module)
{
    $module->someReallyCoolStuff();
    
	// Code today, thank me tomorrow, let us become a stronger community the day after tomorrow
}


Regards,
Konstantinos A. Kogkalidis - a PrestaShop g(r)eek ❤️

  • Like 1
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...