Jump to content

Create tab for module in backoffice


Nazar48

Recommended Posts

I saw here a lot of themes like mine,but i dont get how it work and how should i do.

I am working on Import\Export module so i want to create tab in backoffice in top menu (Catalog,Orders,Clients...here) when module is installing,so i guess i need to write it in my function install() which will create page and tab for module,right?

But how can i do it?i just dont get this system of prestashop.

Link to comment
Share on other sites

You need to create a new tab.

 

On install add:

$tab = New Tab();
        $tab->id_parent = 0; // Parent tab, 0 if you want the first level
        $tab->class_name = 'AdminClassname'; //Name of the class
        $tab->active = 1; //Status
        $tab->module = $this->name; 
        $tab->name[$this->context->language->id] = "Name for the tab";
        $tab->add();

And in uninstall

$tab=new Tab(Tab::getIdFromClassName('AdminClassname'));
        $tab->delete();
Link to comment
Share on other sites

 

You need to create a new tab.

 

On install add:

$tab = New Tab();
        $tab->id_parent = 0; // Parent tab, 0 if you want the first level
        $tab->class_name = 'AdminClassname'; //Name of the class
        $tab->active = 1; //Status
        $tab->module = $this->name; 
        $tab->name[$this->context->language->id] = "Name for the tab";
        $tab->add();

And in uninstall

$tab=new Tab(Tab::getIdFromClassName('AdminClassname'));
        $tab->delete();

but should i create some controller,no?It didnt work,here is my code

http://dpaste.com/321P9X6

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...