Tibo
Tibo

Reputation: 197

Get module version in Prestashop

I have a module installed on my Prestashop and I want to get its version

How can I do this in my code ?

enter image description here

Let's say for example I want to get "v5.0.1"

Thanks for the help !

Upvotes: 0

Views: 1303

Answers (2)

Mahdi Shad
Mahdi Shad

Reputation: 1447

$module = Module::getInstanceByName('bienvenue');
$version = $module->version;

Upvotes: 2

Indrė
Indrė

Reputation: 1136

The version is set in the module file like that:

public function __construct()
{
    $this->name = 'bienvenue';
    $this->version = '5.0.1';

    parent::__construct();

    /* Else code... */
}

Upvotes: 1

Related Questions