Q: How to add multiple sub menu tabs in prestashop administrator module? I have installed one module in a PrestaShop and added left menu with their module name while installing module. I want to add multiple sub menus for module menu tab while installing module. Please help me

A: private function CreateMymoduleAdminTabs() {
        $langs = Language::getLanguages();
        $id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
        $smarttab = new Tab();
        $smarttab->class_name = "AdminModuleName";
        $smarttab->module = "";
        $smarttab->id_parent = 0;
        foreach ($langs as $l) {
            $smarttab->name[$l['id_lang']] = $this->l('Configuration');
        }
        $smarttab->save();
        $tab_id = $smarttab->id;
        $tabvalue = array(
            array(
                'class_name' => 'AdminMenu1',
                'id_parent' => 15,
                'module' => 'modulename',
                'name' => 'tabName1',
            ),
            array(
                'class_name' => 'AdminMenu2',
                'id_parent' => 15,
                'module' => 'modulename',
                'name' => 'tabName2',
            ),
            array(
                'class_name' => 'AdminMenu3',
                'id_parent' => 15,
                'module' => 'modulename',
                'name' => 'tabName3',
            ),
        );
        foreach ($tabvalue as $tab) {
            $newtab = new Tab();
            $newtab->class_name = $tab['class_name'];
            $newtab->id_parent = $tab_id;
            $newtab->module = $tab['module'];
            foreach ($langs as $l) {
                $newtab->name[$l['id_lang']] = $this->l($tab['name']);
            }
            $newtab->save();
        }
        return true;
    }

Call this function in install function of your module.
 $this->CreateMymoduleAdminTabs();
Change the module name and class names as per your module.

