Before you call the variable on tpl you need to assign to array variable $user_data
b_country is part of a profile and the customer can have multiple profile
Script bellow will take the b_country from primary profile
1.
add file
app/addons/my_changes/init.php
with content
<?php
if (!defined('BOOTSTRAP')) { die('Access denied'); }
fn_register_hooks(
'sucess_user_login'
);
2.
add file
app/addons/my_changes/func.php
with content
<?php
if (!defined('BOOTSTRAP')) { die('Access denied'); }
function fn_my_changes_sucess_user_login(&$udata, $auth){
if(!isset($auth['b_country']) && $auth['user_id']>0){
$auth['b_country'] = db_get_field('SELECT b_country FROM `?:user_profiles` WHERE user_id = ?i AND profile_type = ?s', $auth['user_id'], 'P');
}
}
3.
now you can use in tpl
{$auth.b_country}
I hope that helps