chesspiece423 Posted July 21, 2014 Share Posted July 21, 2014 (edited) Hello. I have created my own module. After the installation, I want a new link list appear to the catalog tab(shown in the picture below). Any idea how? Edited July 21, 2014 by chesspiece423 (see edit history) Link to comment Share on other sites More sharing options...
chesspiece423 Posted July 22, 2014 Author Share Posted July 22, 2014 bump please help! Link to comment Share on other sites More sharing options...
vekia Posted July 22, 2014 Share Posted July 22, 2014 this is how i add tab to AdminOrders tab to my free module: delete orders free it adds new menu item to "orders" tab: $this->tabClassName = 'deleteorderstab'; $this->tabParentName = 'AdminOrders'; $tab->class_name = $this->tabClassName; $tab->id_parent = Tab::getIdFromClassName($this->tabParentName); $tab->module = $this->name; $languages = Language::getLanguages(); foreach ($languages as $language) $tab->name[$language['id_lang']] = $this->displayName; $tab->add(); instead of adminOrders use adminCatalog :-) Link to comment Share on other sites More sharing options...
chesspiece423 Posted July 25, 2014 Author Share Posted July 25, 2014 this is how i add tab to AdminOrders tab to my free module: delete orders free it adds new menu item to "orders" tab: $this->tabClassName = 'deleteorderstab'; $this->tabParentName = 'AdminOrders'; $tab->class_name = $this->tabClassName; $tab->id_parent = Tab::getIdFromClassName($this->tabParentName); $tab->module = $this->name; $languages = Language::getLanguages(); foreach ($languages as $language) $tab->name[$language['id_lang']] = $this->displayName; $tab->add(); instead of adminOrders use adminCatalog :-) Thanks you for the reply. But one quick question, where should I put that code? Link to comment Share on other sites More sharing options...
vekia Posted July 25, 2014 Share Posted July 25, 2014 in installation function in your module .php file Link to comment Share on other sites More sharing options...
chesspiece423 Posted July 29, 2014 Author Share Posted July 29, 2014 (edited) Thanks vekia, public function install() { $this->tabClassName = 'deleteorderstab'; $this->tabParentName = 'AdminCatalog'; $tab->class_name = $this->tabClassName; $tab->id_parent = Tab::getIdFromClassName($this->tabParentName); $tab->module = $this->name; $languages = Language::getLanguages(); foreach ($languages as $language) $tab->name[$language['id_lang']] = $this->displayName; $tab->add(); return (parent::install() && Configuration::updateValue('posbang_productsorting_company', Configuration::get('PS_SHOP_NAME')) && Configuration::updateValue('posbang_productsorting_address', '') && Configuration::updateValue('posbang_productsorting_phone', '') && Configuration::updateValue('posbang_productsorting_email', Configuration::get('PS_SHOP_EMAIL')) && $this->registerHook('header') && $this->registerHook('footer')); } That is how I do it, but I get this error below: [PrestaShop] Fatal error in module productsorting:Call to undefined method stdClass::add() Edited July 29, 2014 by chesspiece423 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 29, 2014 Share Posted July 29, 2014 you have to create $tab variable first, it must abe a Tab object $tab = new Tab(); Link to comment Share on other sites More sharing options...
chesspiece423 Posted August 5, 2014 Author Share Posted August 5, 2014 you have to create $tab variable first, it must abe a Tab object $tab = new Tab(); It worked thanks. But I messed up at first. How do I remove the wrong tabs? It won't disappear even if I uninstall the module. Second question is, how can I put a link to my new added tab? When clicked, I want it to redirect to the module I made. Thank you for your assistance. Link to comment Share on other sites More sharing options...
vekia Posted August 5, 2014 Share Posted August 5, 2014 you can remove wrong tabs under administration > menu section in your back office Link to comment Share on other sites More sharing options...
chesspiece423 Posted August 6, 2014 Author Share Posted August 6, 2014 you can remove wrong tabs under administration > menu section in your back office Thanks.. how to remove these links(attachment).. How can I put a link to my new added menu? When clicked, I want it to redirect to the module I made. Thank you for your patience Link to comment Share on other sites More sharing options...
vekia Posted August 6, 2014 Share Posted August 6, 2014 thse links works with module controllers your module has got own admin controller? $this->tabClassName = 'deleteorderstab'; $this->tabParentName = 'AdminCatalog'; $tab->class_name = $this->tabClassName; in this case it's 'deleteorderstab' admin controller, you have to create own controller Link to comment Share on other sites More sharing options...
chesspiece423 Posted August 8, 2014 Author Share Posted August 8, 2014 Thank you for your assistance. I've downloaded your free module and studied it. But I'm really confused, I don't know how should I code it. All I wanted is: 1. Install my module 2. A child 'link' will appear to the parent tab 'AdminCatalog' after installation 3. The 'link' will redirect me to the module I made. Your module is what I'm really talking about. It is what I really needed. Can you instruct me step by step how? Thanks :> much appreciated! Link to comment Share on other sites More sharing options...
Recommended Posts