News:

Support the VirtueMart project and become a member

Main Menu

User change in basket by admin - user list is short

Started by brucezly, September 20, 2024, 13:31:37 PM

Previous topic - Next topic

brucezly

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

hazael

#1
Could you ask just one key question?

AH

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!


Regards
A

Joomla 4.4.5
php 8.1

brucezly

Super, thank You!

It works, but unfortunately I have ~40,000 users...
Does anyone know of an ajax solution for this?