prestashop 1.7-简单模块不';nt工作
我按照本文档章节中的说明创建了简单模块: 这是我的文件/modules/steel/steel.php:prestashop 1.7-简单模块不';nt工作,prestashop,prestashop-1.7,Prestashop,Prestashop 1.7,我按照本文档章节中的说明创建了简单模块: 这是我的文件/modules/steel/steel.php: <?php if (!defined('_PS_VERSION_')) exit; class Steel extends Module { public function __construct() { $this->name = 'steel'; $this->tab = 'front_office_features'; $this-&g
<?php
if (!defined('_PS_VERSION_'))
exit;
class Steel extends Module
{
public function __construct()
{
$this->name = 'steel';
$this->tab = 'front_office_features';
$this->version = '1.0.0';
$this->author = 'Firstname Lastname';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
parent::__construct();
$this->displayName = 'xxx';
$this->description = 'desc';
$this->confirmUninstall = 'deinstall?';
}
public function install()
{
return false;
return true;
}
public function uninstall()
{
if (!parent::uninstall())
return false;
return true;
}
试试这个:
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
class Steel extends Module
{
public function __construct()
{
$this->name = 'steel';
$this->tab = 'front_office_features';
$this->version = '1.0.0';
$this->author = 'Firstname Lastname';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
parent::__construct();
$this->displayName = 'xxx';
$this->description = 'desc';
$this->confirmUninstall = 'deinstall?';
}
public function install()
{
return parent::install();
}
public function uninstall()
{
return parent::uninstall();
}
}
类缺少右括号,install()
方法始终返回false,您没有调用它的父方法。如果您只是在install和uninstall方法中调用父方法,则不需要它们:)