Тема 1.7 не удается отобразить пользовательский модуль
Я пытаюсь prestashop 1.7 и у меня есть проблема с созданием пользовательских модулей. Я создал папку "mymodule" внутри папки" modules", и, как указано в документации, я создал простой mymodule.php файл в нем :
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
if (!defined('_PS_VERSION_'))
exit;
class MyModule extends Module
{
public function __construct()
{
$this->name = 'mymodule';
$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_);
$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');
}
}
?>
Затем я перехожу на страницу администрирования в разделе "модули" - > "модули и службы" на вкладке "установленный модуль", но я не могу найти свой модуль...
Какую ошибку я делаю?
Спасибо
Ксаверий

Ответы - Тема 1.7 не удается отобразить пользовательский модуль / Prestashop 1.7 unable to display custom module

17.03.2017 02:33:03
С твоими шагами все в порядке. Чтобы сделать напоминание, чтобы создать "пользовательский" модуль, мы должны сделать:
- Создайте папку в папке modules, например, с именем ' mycustommodule`
- Создайте php-файл с именем, подобным папке, например ' mycustommodule.РНР`
- Тогда класс" bootstrap " (и конструкция) должен быть таким:
<?php
if (!defined('_PS_VERSION_'))
exit;
class MyCustomModule extends Module
{
public function __construct()
{
$this->name = 'mycustommodule'; /* This is the 'technic' name, this should equal to filename (mycustommodule.php) and the folder name */
$this->tab = 'module type category'; /* administration, front_office_features, etc */
$this->version = '1.0.0'; /* Your module version */
$this->author = 'Firstname Lastname'; /* I guess it was clear */
$this->need_instance = 0; /* If your module need an instance without installation */
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); /* Your compatibility with prestashop(s) version */
$this->bootstrap = true; /* Since 1.6 the backoffice implements the twitter bootstrap */
parent::__construct(); /* I need to explain that? */
$this->displayName = $this->l('My module'); /* This is the name that merchant see */
$this->description = $this->l('Description of my module.'); /* A short description of functionality of this module */
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); /* This is a popup message before the uninstalling of the module */
}
}
?>
Затем для PrestaShop 1.7.x. x вы должны зайти в Modules
и на вкладке Selection
нажать на кнопку "категории" и найти свой модуль (помните фрагмент $ this->tab?)
в противном случае вы можете найти его путем поиска:

30.08.2018 04:04:51
У меня была такая же проблема на версии 1.7.4
Я решил проблему, комментируя следующую строку в файле
\НИЦ\PrestaShopBundle\регулятор\админ\ModuleController.РНР
$filters = new AddonListFilter();
$filters->setType(AddonListFilterType::MODULE | AddonListFilterType::SERVICE);
// ->removeStatus(AddonListFilterStatus::UNINSTALLED);
$installedProducts = $moduleRepository->getFilteredList($filters);
Я не знаю, почему мы не можем увидеть удаленный модуль


01.09.2019 03:40:25
Сегодня я столкнулся с той же проблемой в PrestaShop 1.7.6.1. Найдено 2 решения проблемы:
Zip ваш модуль и загрузить его с помощью Prestashop backoffice. Не очень хорошо, если, например, вы используете git для загрузки изменений. Поэтому я продолжаю искать и нашел решение № 2
Если вы создадите пользовательский модуль, он появится в модуле - > каталог, а не в модулях ->> вкладка модули и Службы... Очень странное и противоречивое интуитивное поведение. После установки этого модуля все работает, как ожидалось.