We wanted to show an img / icon on the users.profile page if they have ordered.
i found another thread where someone used
function fn_my_changes_get_users($params, $fields, $sortings, $condition, $join)
{
$user['user_completed_order'] = db_get_field('SELECT COUNT(*) FROM ?:orders WHERE (email = ?s) AND status IN(?a)', $user['email'], array('C')) ? true : false;
return $params;
}
we added it to the func.php of the my_changes addon, cleared cache but still are not able to access it in the template with $user_data.user_completed_order == true;
We wanted to show an img / icon on the users.profile page if they have ordered.
i found another thread where someone used
function fn_my_changes_get_users($params, $fields, $sortings, $condition, $join)
{
$user['user_completed_order'] = db_get_field('SELECT COUNT(*) FROM ?:orders WHERE (email = ?s) AND status IN(?a)', $user['email'], array('C')) ? true : false;
return $params;
}
we added it to the func.php of the my_changes addon, cleared cache but still are not able to access it in the template with $user_data.user_completed_order == true;
any help is appreciated.
Please try this:
function fn_my_changes_get_user_info($user_id, $get_profile, $profile_id, &$user_data)
{
$user_data['user_completed_order'] = db_get_field('SELECT COUNT(*) FROM ?:orders WHERE (email = ?s) AND status IN(?a)', $user['email'], array('C')) ? true : false;
}