[SOLVED] Change order status, display user who performed the action

Started by EvanGR, November 22, 2019, 09:21:40 AM

Previous topic - Next topic

EvanGR

We have 2+ sales people (i.e. joomla users) which handle orders in VM. We want to see the user who performed each order status change.
Is this information stored/available in the system?

We can do the template override if it's accessible. Thanks

AH

It really depends where you want to see this information

In the orders table modified_by gives the user id that last modified the order - but that might not be what you are looking for as there may be many statuses set in the life of an order

If you want to see the detail for every status in the order detail screen

The order detail contains the status data along with the "virtuemart_order_histories" table data which holds the user_id that set the status in created_by modified_by fields

This can be looked up in the joomla "users" table to get the corresponding name

You could probably do this by loading the virtuemart user model and getting user details using a function within that model

If the user_id is sufficient  - then a view override would probably be sufficient

Once you have the variable populated - you can display


Regards
A

Joomla 3.10.11
php 8.0

EvanGR

Thanks.... I am almost there in creating the ideal override.

One thing missing... how do I get the user object, from the user_id? (from within the order.php template)
I need it to display the username for each order status update.
A specific code example would be very much welcome.

Thanks!

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/