Jump to content

Edit History

M.Arsalan

M.Arsalan

my error is 

Screenshot_1.thumb.png.cdb8473f62918a9b9a0d4e764f5fc5a7.png

code of tab creation :

 $languages = Language::getLanguages(false);

        $tab = new Tab;

        $tab->name = array();

        $tab->class_name = 'JcustomPopup';

        $tab->module = $this->name;

        $tab->id_parent = 0;

        $tab->active = 1;

        foreach($languages as $lan)

        {

            $tab->name[$lan['id_lang']] = $this->l('Johrna Custom Popup');

        }

        $tab->save();

 

        $parentTabID = Tab::getIdFromClassName('JcustomPopup');

        $parentTab = new Tab($parentTabID);

        $tab = new Tab();

        $tab->active = 1;

        $tab->class_name = "JcustomPopup";

        $tab->name = array();

        foreach ($languages as $language) {

            $tab->name[$language['id_lang']] = $this->l('Johrna Custom Popup');

        }

        $tab->id_parent = $parentTab->id;

        $tab->module = $this->name;

        $tab->save();

        return true;

 public function getAdminToken()

    {

        $token = Tools::getAdminTokenLite(

            'JcustomPopup'.

            (int)Tab::getIdFromClassName('JcustomPopup').

            (int)$this->context->employee->id

        );

         return $token;

    }

×
×
  • Create New...