Hi All.
I've got a php function that I need to call on all frontend pages, which will setup a variable to be used in the footer of the site.
I'm trying to use the my_changes add-on as follows
init.php
fn_register_hooks( 'index_footer' );
use Tygh\Registry;if ( !defined(‘AREA’) ) { die(‘Access denied’); }
function fn_my_changes_index_footer()
{
$a_computed_value = ‘blarblabrl’;
Registry::get(‘view’)->assign(‘something’, $a_computed_value);
exit($a_computed_value);
}
Yet its doing nothing? I tried finding the hook from https://www.cs-cart.com/api
Really struggling to figure out how to do custom logic and pass it to templates of my choice, documentation seems very hard to understand if your not familiar with hook systems or smarty :(