Jump to content

override controller in Prestashop - where do the parameters go?


jmpeduto

Recommended Posts

hi, I'm working now in a project that uses prestashop and want to make some overrides to the AdminProductController, to change the interface that is displayed when you want to add a new product in the backoffice. So, my question is, someone know how PS catch the parameters passed to a controller to know what to diplay? For example, in this case, i want to override what the controller does when the addproduct parametr arrives to adminproducts, but don't know how. The url is prestaUrl/adminsite/index.php?controller=adminproducts&addproduct&token=18028b94776533b5ae711fdc37a9e23a.

 

Thanks in davance to anyone

Link to comment
Share on other sites

This is going to depend on what you are trying to change. In v1.5, the back office uses tpl files now, so if you are looking to alter the display of information, then you need to locate the proper tpl file that contains the information, and change it.

 

If you are looking to alter how the information is saved, then there are functions processAdd and processUpdate in AdminProductsController.php.

  • Like 1
Link to comment
Share on other sites

Thanks very much for your quick response bellini! I finally could find how prestashop use the parameters passed to the AdminProductsController to turn them into actions, the solution is in AdminController, at initContent method..

It was thanks to Xdebug, without it wouldn't be possible, debugging AdminProductsController class was the key.

Link to comment
Share on other sites

  • 2 months later...

Thanks very much for your quick response bellini! I finally could find how prestashop use the parameters passed to the AdminProductsController to turn them into actions, the solution is in AdminController, at initContent method..

It was thanks to Xdebug, without it wouldn't be possible, debugging AdminProductsController class was the key.

 

Hi jmpeduto!..could you explain what did you change please?..thankss

Link to comment
Share on other sites

  • 2 weeks later...

Cristrinity, hi, sorry by the delay in answering.. what I did was to override the method processAdProduct in AdminProductsController to manage the product add method. In prestashop when you send and action to a controller, like addProduct, the action is prepend with the "process" word. If you need more help ask me!

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