Chetanilead Posted June 27, 2014 Share Posted June 27, 2014 Hi All, Can anyone please tell me that How can I add new tab in admin section under the catalog. Thanks in advance. Link to comment Share on other sites More sharing options...
bellini13 Posted June 27, 2014 Share Posted June 27, 2014 What would this tab do? Link to comment Share on other sites More sharing options...
vekia Posted June 27, 2014 Share Posted June 27, 2014 go to administration > menus you can define there new menu items remember that you have to create new controllers to display some pages etc. Link to comment Share on other sites More sharing options...
Chetanilead Posted June 28, 2014 Author Share Posted June 28, 2014 Thanks Vekia but I need more information how can I add controller to dipslay content for that tab. I need to display a form with various fields and store the values in database. please let me know if there is any tutorial related with this is available. I need to create it like we create product in prestashop Link to comment Share on other sites More sharing options...
vekia Posted June 28, 2014 Share Posted June 28, 2014 hello check how other controllers look like: /controllers/admin/ directory you have to create own controller based on the same way as other controllers are created. remember that your controller must have own unique name and unique class for example: class AdminMyTabControllerCore extends AdminController { public function __construct(){ // do something } // controller functions here } Link to comment Share on other sites More sharing options...
bellini13 Posted June 28, 2014 Share Posted June 28, 2014 go into the resources menu, developer guide and search Link to comment Share on other sites More sharing options...
Chetanilead Posted June 28, 2014 Author Share Posted June 28, 2014 hello check how other controllers look like: /controllers/admin/ directory you have to create own controller based on the same way as other controllers are created. remember that your controller must have own unique name and unique class for example: Hello Vekia, I have added AdminVehicles as a class_name in ps_tab table and I have created \controllers\admin\AdminVehiclesController.php and in this file I have added the following code class AdminVehiclesControllerCore extends AdminController { public function __construct(){ echo "called"; } // controller functions here } But still it shows controller not found error. Could you please let me know what is the issue. Thanks in advance Link to comment Share on other sites More sharing options...
vekia Posted June 28, 2014 Share Posted June 28, 2014 code that i pasted is only an example and it's not complete controller. you have to create there functions to display contents in .tpl file etc. in addition, go to cache and remove class-index.php file it contains lists of controllers after page refresh file will be regenerated. Link to comment Share on other sites More sharing options...
Chetanilead Posted June 29, 2014 Author Share Posted June 29, 2014 code that i pasted is only an example and it's not complete controller. you have to create there functions to display contents in .tpl file etc. in addition, go to cache and remove class-index.php file it contains lists of controllers after page refresh file will be regenerated. Link to comment Share on other sites More sharing options...
Chetanilead Posted June 29, 2014 Author Share Posted June 29, 2014 I have created the complete controller and also deleted the class-index.php file from cache folder but it still show the same error. Controller not found. Please help what can I do now.thanks in advance Link to comment Share on other sites More sharing options...
vekia Posted June 29, 2014 Share Posted June 29, 2014 can you show screenshot of your new menu item (tab) configuration? Link to comment Share on other sites More sharing options...
Chetanilead Posted June 30, 2014 Author Share Posted June 30, 2014 Hello Vekia, Please find the attached screenshot for the error which I have got when i clicked on the tab created by me. Link to comment Share on other sites More sharing options...
Chetanilead Posted June 30, 2014 Author Share Posted June 30, 2014 Please find the screenshot for menu configuration setting as well Link to comment Share on other sites More sharing options...
Chetanilead Posted July 1, 2014 Author Share Posted July 1, 2014 Hello vekia, I have resolved that controller not found issue by adding module name at the time of tab creation but currently I am facing two new issues. 1. I have created one more tab but when I click on that tab it will redirecting me on login page. How can I fix this please help. 2. I have successfully created to list all the vehicles when someone clicks on my tab. But where I have to code to display a form from which admin user can add new vehicle. when I click on add new button it redirect me to following URL http://localhost/prestashop/admin6307/index.php?controller=AdminVehicles&addvehicles&token=f564faef1418154071a93f61a3dc0599 Could you please tell where I have to write code for that. Thanks in advance Link to comment Share on other sites More sharing options...
Chetanilead Posted July 3, 2014 Author Share Posted July 3, 2014 I have fixed the all the issue which I have mentioned above. Thanks all for help and support :) 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