2013-02-06 39 views
1

我想在prestashop中創建自定義模塊,但它不顯示在後臺的模塊選項卡中。Prestashop:自定義模塊未顯示在後臺

我創建了一個非常基本的測試模塊,但即使這樣也不會顯示在後臺。

我的文件夾中的單個文件text.php:模塊/測試 這是文件的代碼:

<?php 

if (!defined('_PS_VERSION_')) 
    exit; 

class Test extends Module 
{ 
    public function __construct() 
    { 
     parent::__construct(); 

     $this->name = 'Test'; 
     $this->tab = 'Test'; 
     $this->version = 1.0; 
     $this->author = 'Test'; 
     $this->need_instance = 0; 

     $this->displayName = 'TEST'; 
     $this->description = 'TEST'; 
    } 

    public function install() 
    { 
     return (parent::install()); 
    } 
} 

據我理解,這是不夠的基本模塊露面在後臺的模塊選項卡中。

任何想法可能是錯誤的?

+0

嘗試將您的text.php重命名爲test.php –

回答

2

在您的測試模塊可以有那幾個原因:你需要有你的名字你的文件一樣的文件夾,以便將模塊/測試文件夾中的test.php

  1. $ this-> name ='test';測試應該如Prestashop official guide 'name'屬性中所述的小寫。作爲內部標識符,因此使其具有唯一性,沒有特殊字符或空格,並保持小寫。

0

注意parent :: __ construct()的位置;

我想你在設置足夠的信息之前先給父母打電話。我還建議爲你的測試模塊使用一個不同的名稱,不太通用。

<?php 

if (!defined('_PS_VERSION_')) 
    exit; 

class Test extends Module 
{ 
    public function __construct() 
    { 

     $this->name = 'Test'; 
     $this->tab = 'Test'; 
     $this->version = 1.0; 
     $this->author = 'Test'; 
     $this->need_instance = 0; 

     parent::__construct(); 

     $this->displayName = 'TEST'; 
     $this->description = 'TEST'; 
    } 

    public function install() 
    { 
     return (parent::install()); 
    } 
} 
0

您使用的是什麼版本的PS?如果< 1.5,似乎是一個穩定的和更少的bug 1.4.10被釋放前幾天。 我在我的網站Panapaná(http://www.panapana.com.br)上使用1.4.10,並在使用1.4.8.2時遇到了類似的問題。遷移到1.4.10後,此問題不再存在。

相關問題