Jump to content

Module new tab not showing up


Recommended Posts

Hi,

Im learning Prestashop and im stuck with module tab installation. 

Module configuration works fine but I want create new tab somewhere in sidebar.

 

What I've tried to do:

    public function __construct()
    {
        $this->name = 'marinisync';
        $this->tab = 'administration';
        $this->version = '1.0.0';
        $this->author = 'TEST TLD';
        $this->need_instance = 0;
        $this->bootstrap = true;
        $this->displayName = $this->l('Marini Sync');
        $this->description = $this->l('Sync Marini products');
        $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
        parent::__construct();
    }

    protected function createTab()
	{
		$langs                = Language::getLanguages();
		$smarttab             = new Tab();
		$smarttab->class_name = 'AdminMariniSync';
		$smarttab->module     = '';
		$smarttab->id_parent  = 0;
		foreach ($langs as $l) {
			$smarttab->name[$l['id_lang']] = $this->l('Marini Sync');
		}
		$smarttab->save();
		return true;
	}

    /**
     * Don't forget to create update methods if needed:
     * http://doc.prestashop.com/display/PS16/Enabling+the+Auto-Update
     */
    public function install()
    {
        return $this->installDb() &&
            parent::install() &&
            $this->registerHook('header') &&
            $this->registerHook('backOfficeHeader') &&
            $this->createTab();
    }

 

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...