Hello,
I have looked into several solutions to see how I can input phone orders as an administrator. Currently, I cannot use the user switch option in the cart because it only lists a small portion of the existing users (even with the original template).
Where should I look for the option to extend it? Is anyone perhaps using a different solution?
VM.4.2.18. Joomla 4.4.8
Could you ask just one key question?
This will require a change to the user model and a template change
I did this:-
if($adminID){
$user = JFactory::getUser($adminID);
if($current->id!=$user->id){
$toAdd = new stdClass();
$toAdd->id = $user->id;
$toAdd->name = $user->name;
$toAdd->username = $user->username;
$toAdd->displayedName = vmText::sprintf('COM_VIRTUEMART_RETURN_TO',$user->name,$user->username);
// quorvia need longname here also for better list display
$toAdd->displayedLongName = $user->name .' '. $user->username;
array_unshift($result,$toAdd);
}
}
Then adjusted the selection in the cart/tmpl view / default_shopperform.php
To change the selection option from this:
echo JHtml::_('select.genericlist', $this->userList, 'userID', 'class="vm-chzn-select" style="width: 200px"', 'id', 'displayedName', $currentUser,'userIDcart');
To this
echo JHtml::_('select.genericlist', $this->userList, 'userID', 'class="vm-chzn-select" style="width: 200px"', 'id', 'displayedLongName', $currentUser,'userIDcart');
Note: Changing the user model will get overwritten on every update!
Super, thank You!
It works, but unfortunately I have ~40,000 users...
Does anyone know of an ajax solution for this?
No, not yet, but you can search for users and then you have a shorter list with the found word parts. I thought about to ajaxify it, but need a sponsor, for example an extra silver membership.