Jump to content

Custom admin module database operations


samuelprabhu
 Share

Recommended Posts

Hi!

      I am using prestashop version 1.6 and developing custom admin module which completely consist of all the operations in backend only.

 

I am unable to sort certain things and  struggling specifically database operations.

 

I have created a model, controller and tpl by referring https://github.com/P...e-Prestashop-15

 

my doubts are,

1) what is the purpose of postProcess() method?

2) how to differentiate add and update operations?

3) how to load values to the form in case of edit?

4) ajax call to controller?

 

I just need a example for the above things.

 

Anyone there to help to get clear idea.

Share this post


Link to post
Share on other sites

You have a lot examples on the Prestashop code

 

Go to the admin controllers of the Prestashop you need to check out the code and look how they work on the back office

 

 

 

1) postProcess get the control after a submit of the form

 

2) you can  the separate process by checking the button name at the submit

 

3) You can use the helpers to load the data , if you define your model, table with the helpers is automatic you need read the documentation

 

4) what do you need know about the ajax calls

Share this post


Link to post
Share on other sites

You have a lot examples on the Prestashop code

 

Go to the admin controllers of the Prestashop you need to check out the code and look how they work on the back office

 

 

 

 

Thanks Jgamio,

 

     I solved the db operations edit and save issues by calling parent::postProcess();.

Edited by samuelprabhu (see edit history)

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More