Skip to main content

Show Joomla Username and ID on customer details

More
10 years 5 months ago #235679 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.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #235691 by nicolas
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

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #235803 by KarenJohnson
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.

More
10 years 5 months ago - 10 years 5 months ago #235829 by KarenJohnson
Last edit: 10 years 5 months ago by KarenJohnson.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #235893 by korzo
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');
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.

More
10 years 5 months ago #235804 by nicolas
Hi,

Well, it's quite simple.
As you can see there, this displays the name of the user:
Code:
<?php echo @$this->order->customer->name; ?>
So to display the username it's:
Code:
<?php echo @$this->order->customer->username; ?>
And for the id:
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.

More
10 years 5 months ago #237692 by KarenJohnson
It worked! Thanks so much

Please Log in or Create an account to join the conversation.

Time to create page: 0.214 seconds
Powered by Kunena Forum