- Posts: 126
- Thank you received: 2
How to get user name/id in order history
I just bought business version and found a lot of interesting features in this version. What i can't find is how and where to get the user id or name of user who modified the status of an order. In my case, i'm just the administrator of website but orders are processed by other peoples (editors). Would be great to see this info (editors names) in orders history area instead of (or near) IP column for example.
Here is what i tried so far: in administrator/com_hikashop/plg_hikashop_history/history.php i added in
function onAfterOrderUpdate(&$order,&$send_email){
$user =& JFactory::getUser();
if ($user->get('id') > 0) {
$utilizator = $user->get('id');
}
$history->history_user = $utilizator;
i created a field history_user in table but i dont' get the value in..
Thank you
Please Log in or Create an account to join the conversation.
$order->history->history_user = $utilizator;
Please Log in or Create an account to join the conversation.
function onAfterOrderUpdate(&$order,&$send_email){
$user =& JFactory::getUser();
if ($user->get('id') > 0) {
$utilizator = $user->get('id');
}
$order->history->history_user = $utilizator;
if(!empty($order->order_id)){
....
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
$history->history_reason = @$order->history->history_reason;
$history->history_notified = @$order->history->history_notified;
$history->history_amount = @$order->history->history_amount;
$history->history_package_id = @$order->history->history_package_id;
$history->history_payment_id = @$order->history->history_payment_id;
$history->history_payment_method = @$order->history->history_payment_method;
$history->history_data = @$order->history->history_data;
$history->history_type = @$order->history->history_type;
to:
foreach(get_object_vars($order->history) as $k => $v){
$history->$k = $v;
}
so that the new columns are taken into account by the history plugin. We'll do the modification on our end too so that you won't have problems next time you update.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Any chance to get this update? We can't start our shop without this option available...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
ALTER TABLE `jos_hikashop_history` ADD `history_user_id` INT UNSIGNED DEFAULT 0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.