- Posts: 15
- Thank you received: 0
Select cust by name not email | new backend orders
14 years 1 month ago #62365
by gmarsh
Select cust by name not email | new backend orders was created by gmarsh
When using backend order creation, my client would prefer to select the customer by name rather than email from the dropdown field provided. I've narrowed the file(s) that need to be modified (I think) to order/user.php, but am unsure of the changes that need to be made. Please advise!
Thanks for your help!
Gary Marsh
Thanks for your help!
Gary Marsh
Please Log in or Create an account to join the conversation.
14 years 1 month ago #62411
by Xavier
Replied by Xavier on topic Re: Select cust by name not email | new backend orders
Hi gmarsh,
You have to edit the file \administrator\components\com_hikashop\types\user.php and replace your load function by:
You have to edit the file \administrator\components\com_hikashop\types\user.php and replace your load function by:
Code:
function load($value){
$this->values = array();
$query = 'SELECT user_id, user_cms_id, user_email FROM '.hikashop_table('user');
$db =& JFactory::getDBO();
$db->setQuery($query);
$users = $db->loadObjectList('user_id');
$query = 'SELECT * FROM '.hikashop_table('users',false).' ';
$db->setQuery($query);
$usersCms = $db->loadObjectList();
if(!empty($users)){
foreach($users as $user){
foreach($usersCms as $userCms){
if($userCms->id == $user->user_cms_id)
$this->values[] = JHTML::_('select.option', (int)$user->user_id, $user->user_id . ' ' .$userCms->username );
}
}
}
}
The following user(s) said Thank You: gmarsh
Please Log in or Create an account to join the conversation.
14 years 1 month ago #62465
by gmarsh
Replied by gmarsh on topic Re: Select cust by name not email | new backend orders
That worked beautifully! Thank you so much for your quick and comprehensive response.
Gary Marsh
Gary Marsh
Please Log in or Create an account to join the conversation.
Time to create page: 0.218 seconds