Madsex Posted April 11, 2017 Share Posted April 11, 2017 Hi, i have create a simple moduke that add some tab in bo menù. Actually i click on tab create and on right i see a page black with module title on the header. This is the simple code: <?php if (!defined('_PS_VERSION_')) { exit; } class Farmacustom extends Module { public function __construct() { $this->name = 'farmacustom'; $this->tab = 'administration'; $this->version = '1.0.0'; $this->author = 'author'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Farma Custom'); $this->description = $this->l('Funzioni custom'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); } public function install() { Configuration::updateValue('FARMACUSTOM_LIVE_MODE', false); $tab = new Tab(); $tab->class_name = 'Farmacustom'; $tab->module = $this->name; $tab->active = 1; //Status $tab->id_parent = 0; $languages = Language::getLanguages(false); foreach ($languages as $lang){ $tab->name[$lang['id_lang']] = 'Presta'; } $tab->save(); $tab_id = $tab->id; $tab = new Tab(); $tab->class_name = 'Farmacustom'; $tab->module = $this->name; $tab->id_parent = $tab_id; $tab->active = 1; //Status $languages = Language::getLanguages(false); foreach ($languages as $lang){ $tab->name[$lang['id_lang']] = 'Presta Bis'; } $tab->save(); return parent::install() && $this->registerHook('displayBackOfficeHeader'); } public function uninstall() { Configuration::deleteByName('FARMACUSTOM_LIVE_MODE'); return parent::uninstall(); } public function hookDisplayBackOfficeHeader(){ } } How i can manage the pages create from this module? I would create other tab and every tab have a page with a form or other information that i would create in a template .tpl. Someone can help me? Thanks a lot. Link to comment Share on other sites More sharing options...
NemoPS Posted April 13, 2017 Share Posted April 13, 2017 Did you create a controller for the tabs? That's what classname is for. If you need a guide, I have a course that covers the topic pretty extensively: http://nemops.com/prestashop-modules-course/ Link to comment Share on other sites More sharing options...
Madsex Posted April 17, 2017 Author Share Posted April 17, 2017 Thanks for help, i have create a controller and in that page i write my script. Can i ask your attention on another big problem? Here the topic that i opened: https://www.prestashop.com/forums/topic/605483-catalog-list-in-bo-issue/ Thanks for help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now