簡體   English   中英

新的 Prestashop 模塊未顯示在模塊列表中

[英]New Prestashop module is not showing in module list

我正在按照 教程Prestashop 1.7 創建一個模塊,我的實際代碼是這樣的:

/themes/myTheme/modules/hwmodule/hwmodule.php

class HwModule extends Module
{
    public function __construct() {
        $this->name = 'hwmodule';
        $this->tab = 'front_office_features';
        $this->version = '1.0.0';
        $this->author = 'Lai';
        $this->need_instance = 0;
        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
        $this->bootstrap = true;

        parent::__construct();

        $this->displayName = $this->l('My module');
        $this->description = $this->l('Description of my module.');

        $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');

        if(!Configuration::get("MYMODULE_NAME"))
            $this->warning = $this->l('No name provided');
    }

}

正如文檔中所寫,此代碼允許進行基本安裝,但是當我在我的模塊列表(管理 > 模塊 > 模塊和服務)中找不到它時。

我的代碼有什么問題?

該模塊應位於/modules/hwmodule/hwmodule.php themes/myTheme/modules/hwmodule/可以放置主題tpl。 例如,如果您在/modules/hwmodule/views/template.tpl使用模板,您可以為每個主題修改相同的模板,將其放置在themes/myTheme/modules/hwmodule/views/template.tpl

您應該將您的模塊放在正確的目錄中:/prestashop/modules/modulename/modulename.php 否則您的代碼或 Prestashop 1.7 文檔中有關此主題的文檔沒有任何問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM