No replies
asadpakistani's picture
Offline
Joined: 06/09/2011
Juice: 7
Was this information Helpful?

Ubercart shows user id numbers on admin and user comment tables on order view pages. This works fine for a small store, but for a store with many employees they might want to be able to see the user name to coordinate amongst each other regarding issues on orders. This module is my humble approach towards fixing this issue. Any feedback is welcomed. In your info file add uc_order as a dependency for organization. Thank you.

<?php
function HOOK_tapir_table_alter(&$comments) {
    if(isset(
$comments['#parameters'][0]) && ($comments['#parameters'][0] == 'op_order_comments_view_table' || $comments['#parameters'][0] == 'op_admin_comments_view_table')) {
       
$i = 0;
        foreach(
$comments['#rows'] as $row) {
            if(
is_numeric($row['user']['#value'])) {
               
$user = user_load($row['user']['#value']);
               
$comments['#rows'][$i]['user']['#value'] = l($user->name, 'user/'.$user->uid);
            }
           
$i++;
        }
    }
}
?>