what is the main concept of CS-Cart 3 code flow and data handling

I reed a lot in the Developer doc. at the cs-cart Documentation but till now i can't catch the main concept of CS-Cart 3 code flow between the controllers and functions



by example

i arrange now new code that can catch new variable in URL and send it by mail after regestaration completed

i create the addon but the function in the func.php file can't treat the URL variable directly

so i have now miss understanding about who run firstly addon func.php or addon controller.php

and how the controller file can move variable to func.php or take variable from it



plz help

Two general types of hooks in the PHP side of things.

First are 'hooks' registered with fn_register_hooks() and functions in func.php. These are executed when the standard PHP function is run.



The second are hooks into the controllers. I.e. checkout.pre.php and checkout.post.php.

These are run before (pre) and after (post) the hooks above. So the flow is:

checkout.pre.php

standard controller

fn_set_hook() hook functions

checkout.post.php