当我在prestshop中安装模块时,我得到一个错误



每当我尝试安装下面的模块时,我都会得到一个错误:×You没有权限配置此模块。

NB。该模块是从prestshop迁移到shopify

谢谢你的帮助下面是该模块的代码:

if (!defined('_PS_VERSION_')) {
exit;
}
class ShopifyExport extends Module
{
const CONTROLLER_CLASS = 'AdminExportToShopify';
protected $config_form = false;
protected $minimum_php_version;
public function __construct()
{
$this->name = 'shopifyexport';
$this->tab = 'export';
$this->version = '1.2.2';
$this->author = 'Shopify';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Export for Shopify');
$this->description = $this->l('Export your store's data for an easy migration to Shopify.');
$this->minimum_php_version = '5.5';
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
public function install()
{return true;
if (!parent::install() || !$this->checkPhpVersion()) {
return false;
}
$this->installController();
}
private function installController()
{
$this->uninstallController();
$parentTabId = Tab::getIdFromClassName('Configure');
if (!$parentTabId) {
$parentTabId = Tab::getIdFromClassName('Default');
}
$tab = new Tab();
$tab->icon = 'cloud_download';
$tab->class_name = self::CONTROLLER_CLASS;
$tab->id_parent = $parentTabId;
$tab->module = $this->name;
foreach (Language::getLanguages(false) as $lang) {
$tab->name[(int)$lang['id_lang']] = $this->displayName;
}
$tab->save();
}
public function uninstall()
{
$this->uninstallController();
return parent::uninstall();
}
public function uninstallController()
{
$tabId = TabCore::getIdFromClassName(self::CONTROLLER_CLASS);
if ($tabId) {
$tab = new Tab($tabId);
$tab->delete();
}
}
public function getContent()
{
Tools::redirectAdmin($this->context->link->getAdminLink(self::CONTROLLER_CLASS));
}
private function checkPhpVersion()
{
if (version_compare(phpversion(), $this->minimum_php_version, '<')) {
$this->_errors[] = Tools::displayError('The version of your module requires PHP 5.5 or higher.');
return false;
}
return true;
}
}

如果我尝试激活我的模块,我总是看到这个错误:

×You没有配置该模块的权限。

我正在使用Prestashop版本1.6.0.14

这看起来更像是权限问题,而不是模块中的代码问题。

尝试卸载/重新安装模块以修复用户权限和/或确保您的员工配置文件带有"configure"该模块的权限(查看ps_module_access)表).

相关内容

  • 没有找到相关文章

最新更新