Jump to content

Adding stuff in BackOffice


i92guboj

Recommended Posts

Hello.

 

I am new to this forum and to prestashop as a whole, so, please, forgive my ignorance and just bear with me.

 

I am trying to learn the intrincacies of prestashop by developing a module which, ideally, should tie a discount ticket code to a given employee. The idea, for now, is to create the ticket "by hand", and then put the ticket code in a new field I created in the employees table (let's call that field) "seller_code". That part is done, and works, more or less.

 

Then, an sql query will list some info joined from many tables, the details are not relevant. SQL is not a problem.

 

The part I am stuck with is: the module should display the result of the query (and allow filtering, printing, etc. but that's for a later stage) at the bottom of the employees backoffice page, below the employees options or wherever, but I have no idea how to "hook" there. I've been searching for a couple of days and I haven't found a way to hook on this concrete backoffice tab. Maybe I am just to lame to be able to recognise the thing when I find it. Or maybe it's not "hooks" what I should be looking at.

 

Can someone point me in the right direction?

 

I can write the code, I just don't know where or what hehe. 

 

Thanks beforehand for any hint you can give me.

Link to comment
Share on other sites

The employee page is created using the file /controller/adminAdminEmployeesController.php

 

It uses a helper form:

/<your admin folder>/themes/default/template/controllers/employees/helpers/form/form.tpl

 

In the controller, you could add some smarty assigned variable:

 

$this->context->smarty->assign('yourvar', $yourPHPGeneratedSQLResultVar);
 
Then maybe simplest is to directly add in the helper form the {$yourvar} to display the value of your $yourPHPGeneratedSQLResultVar on the page.
 
Hope it works, hope it helps,
 
pascal.
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...