but it appears that full controllers can only be modified by pre or post.
Is this true???
For example:
I would like to insert some code around line 110 in the:
\controllers\customer\products.php file, just before:
$view->assign('product', $product);
```<br />
<br />
obviously using a pre or post controller addon will not acheive this.<br />
<br />
I have tried to create \addons\my_changes\controllers\customer\products.override.php (which is a copy of the regular products.php file with my extra bit of code added) to do this, but it doesn't seem to work.<br />
<br />
Can I not override the entire controller, or is there another way I can do what I want to do?<br />
<br />
Thanks in advance for any input.
But you can use a pre controller to modify what’s in the $_REQUEST (POST or GET) parameters or there are probably PHP hooks to add/modify/delete elements of the product_data array where functions are called by the products controller. As an example, you can add a hook to modify what’s returned by fn_get_product_data() by adding this line to your init.php in my_changes:
fn_register_hook('get_product_data_more');
Then add a function to func.php of:
function fn_my_changes_get_product_data_more(&$product_data, &$auth) {
Modify the product data as you want
}
I would think the latter method would be more of what you’re looking for but you’re not saying what you want to accomplish.