Sertaç Bazancir Posted September 14, 2018 Share Posted September 14, 2018 Hello everyone, I'm new on developing module of Prestashop and I use version of 1.7.4.2. I'm trying to develeping a module and I have to create a custom tab in left menu in back office. I tried this way which in the Prestashop official documentation(https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/tabs/). But custom tab doesn't visible in the back office. Here I add my code and my file names. Can anyone help me about where is my mistake? Thank you so much. My Files driveorder -driveorder.php -logo.png -controllers --admin ---AdminDriveOrder.php And there is driveorder.php file which is I created custom tab. <?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->controllers = array('driveProducts'); $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' => 'AdminCatalog', ) ); } 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; } } ?> Link to comment Share on other sites More sharing options...
anis_r Posted February 13, 2020 Share Posted February 13, 2020 Hello, did you find the solution for this? I am facing the same issue now, on the exact same version of Prestashop (1.7.4.2). 1 Link to comment Share on other sites More sharing options...
oyale Posted April 13, 2020 Share Posted April 13, 2020 Hello! I'm too facing the same situation with the same version of Prestashop. The 'tab' attribute works properly neither: all the modules appear under the 'Other' tab. Link to comment Share on other sites More sharing options...
w3bsolutions Posted August 24 Share Posted August 24 In my case resetting the module solved it, and the new tab appeared. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now