Пользовательская вкладка бэк-офиса не отображается в Prestashop

Я новичок в разработке модуля Prestashop, и я использую версию 1.7.4.2. Я пытаюсь разработать модуль, и мне нужно создать настраиваемую вкладку в левом меню в бэк-офисе. Я пробовал этот способ, который есть в официальной документации Prestashop (https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/tabs/). Но настраиваемая вкладка не отображается в бэк-офисе. Здесь я добавляю свой код и имена файлов. Может ли кто-нибудь помочь мне в том, в чем моя ошибка? Большое спасибо.

Мои файлы

привод

-driveorder.php

-logo.png

-контроллеры

--админ

--- AdminDriveOrder.php

И есть файл driveorder.php, в котором я создал настраиваемую вкладку.

<?php
if (!defined('_PS_VERSION_'))
    exit;

class driveorder extends Module
{
    public function __construct()
    {
        $this->name = 'driveorder'; /* This is the 'technic' name, this should equal to filename (mycustommodule.php) and the folder name */
        $this->tab = 'administration'; /* administration, front_office_features, etc */
        $this->version = '1.0.0'; /* Your module version */
        $this->author = 'Sertac Bazancir'; /* 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('Drive Order'); /* This is the name that merchant see */
        $this->description = $this->l('Google Drive integration for virtual products.'); /* 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 uninstall */

        $this->tabs = array(
            array(
                'name' => 'Drive Order', // One name for all langs
                'class_name' => 'AdminDriveOrder',
                'visible' => true,
                'parent_class_name' => 'SELL'
            )
        );

    }

    public function install(){
        if (Shop::isFeatureActive()){
            Shop::setContext(Shop::CONTEXT_ALL);
        }
        $sql = "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."drive_product`(
        `id_product` INT(10) NOT NULL PRIMARY KEY,
        `id_drive` VARCHAR(255) NOT NULL )";
        $result = Db::getInstance()->Execute($sql);
        if (!parent::install() OR !$result OR !$this->registerHook('actionPaymentConfirmation')){
            return false;
        }
        return true;
    }

    public function uninstall(){
        $sql = "DROP TABLE `"._DB_PREFIX_."drive_product`";
        $result = Db::getInstance()->Execute($sql);
        if (!parent::uninstall() OR !$result OR !Configuration::deleteByName('driveorder')){
            return false;
        }
        return true;
    }

    public function hookActionPaymentConfirmation($params){
        global $smarty;
    }
}
?>

person Sertaç Bazancir    schedule 14.09.2018    source источник
comment
В prestashop явно есть ошибка, каждый раз, когда я сбрасываю модуль, он ведет себя по-другому - иногда вкладка доступна, иногда нет.   -  person Elia Weiss    schedule 16.07.2019
comment
Спустя год я столкнулся с той же проблемой ... Вам удалось ее исправить?   -  person Anis R.    schedule 13.02.2020


Ответы (2)


Ваша ошибка здесь:

'parent_class_name' => 'SELL'

Попробуй это:

'parent_class_name' => 'AdminParentOrders'
person Mahdi Shad    schedule 14.09.2018
comment
Прежде всего, большое спасибо за ответ. Я пробовал, но, к сожалению, он все еще не виден. - person Sertaç Bazancir; 15.09.2018
comment
Вы сбросили модуль? - person Mahdi Shad; 15.09.2018
comment
да. Сбросил после изменений. - person Sertaç Bazancir; 15.09.2018

Вы также должны назвать свой файл контроллера AdminDriveOrderController.php вместо AdminDriveOrder.php

person ébewè    schedule 20.09.2018