Jump to content

Add new tab in admin section under catalog


Chetanilead

Recommended Posts

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

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

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

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

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

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

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