It depends on when you want this action to happen. Like always with prestashop, you have 2 possibilities :
Override an existing controller
For example if you want to add a product to the cart everytime its created, you might want to override CartController. In that case here is the answers to your questions :
- In the
override/controllers
folder.
- The parent controller you chose, for example CartControllerCore
- The same as the parent controller. Check the official doc about the dispatcher, it's pretty usefull
Create you own module
I think this is the best choice if you want to have a real control over when you trigger this action.
- In the modules/you_module/controllers folder. The official doc is also a great place to start.
- ModuleFrontController
- Refer to the page about the dispatcher I gave you above, but the best way to trigger your action is to use the hook system.