Skip to main content

Select cust by name not email | new backend orders

More
14 years 1 month ago #62365 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

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

More
14 years 1 month ago #62411 by Xavier
Hi gmarsh,

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.

More
14 years 1 month ago #62465 by gmarsh
That worked beautifully! Thank you so much for your quick and comprehensive response.
Gary Marsh

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

Time to create page: 0.218 seconds
Powered by Kunena Forum