- Posts: 4
- Thank you received: 0
Show Joomla Username and ID on customer details
- KarenJohnson
-
Topic Author
- Offline
Less
More
10 years 5 months ago #235679
by KarenJohnson
Show Joomla Username and ID on customer details was created by KarenJohnson
On the Order details page of the backend of HikaShop, it has the boxes Main Information, Additional Information, Customer, Billing address, shipping address. In the customer box it shows name, email and Id (this is the customerID in Hikashop).
I want to also see the Joomla username and Joomla ID. Is this possible? If so how? I can't work out which file in Display>View relates to that customer display box.
I want to also see the Joomla username and Joomla ID. Is this possible? If so how? I can't work out which file in Display>View relates to that customer display box.
Please Log in or Create an account to join the conversation.
10 years 5 months ago #235691
by nicolas
Replied by nicolas on topic Show Joomla Username and ID on customer details
Hi,
It's the file "show" of the view "order" that you can edit for your backend template via the menu Display>views.
It's that code you're looking for in there:
take.ms/T8OU9
It's the file "show" of the view "order" that you can edit for your backend template via the menu Display>views.
It's that code you're looking for in there:
take.ms/T8OU9
Please Log in or Create an account to join the conversation.
- KarenJohnson
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
10 years 5 months ago #235803
by KarenJohnson
Replied by KarenJohnson on topic Show Joomla Username and ID on customer details
That's great thank Nicholas.... but what code do I need to add? to show Joomla username and Joomla ID
Please Log in or Create an account to join the conversation.
- KarenJohnson
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
10 years 5 months ago - 10 years 5 months ago #235829
by KarenJohnson
Replied by KarenJohnson on topic Show Joomla Username and ID on customer details
x
Last edit: 10 years 5 months ago by KarenJohnson.
Please Log in or Create an account to join the conversation.
10 years 5 months ago #235893
by korzo
Replied by korzo on topic Show Joomla Username and ID on customer details
Here is code from my modification. It was done for Hikashop 2.6.1 but I think it should work also in Hikashop 2.6.2.
Add it at the very top of the file, right after defined('_JEXEC') or die('Restricted access');
Add it at the very top of the file, right after defined('_JEXEC') or die('Restricted access');
Code:
if (!empty($this->order->customer->user_cms_id)) {
$u = new JUser((int)$this->order->customer->user_cms_id);
$this->extra_data['user'][] = array(
'title' => 'Username',
'data' => $u->username
);
$this->extra_data['user'][] = array(
'title' => 'Joomla user ID',
'data' => '<a href="index.php?option=com_users&view=user&layout=edit&id='.$u->id.'">'.$u->id.'</a>'
);
}
Please Log in or Create an account to join the conversation.
10 years 5 months ago #235804
by nicolas
Replied by nicolas on topic Show Joomla Username and ID on customer details
Hi,
Well, it's quite simple.
As you can see there, this displays the name of the user:
So to display the username it's:
And for the id:
Well, it's quite simple.
As you can see there, this displays the name of the user:
Code:
<?php echo @$this->order->customer->name; ?>
Code:
<?php echo @$this->order->customer->username; ?>
Code:
<?php echo @$this->order->customer->id; ?>
The following user(s) said Thank You: KarenJohnson
Please Log in or Create an account to join the conversation.
- KarenJohnson
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
10 years 5 months ago #237692
by KarenJohnson
Replied by KarenJohnson on topic Show Joomla Username and ID on customer details
It worked! Thanks so much
Please Log in or Create an account to join the conversation.
Time to create page: 0.214 seconds