News:

Looking for documentation? Take a look on our wiki

Main Menu

Order editing conflicts (multiple users)

Started by EvanGR, March 22, 2021, 10:45:24 AM

Previous topic - Next topic

EvanGR

Hello,

We have 3 employees handling the orders, and we want to prevent an order from being edited by two people at once (accidentally). Is there a provision for that?

(Joomla usually has a lock mechanism to prevent that scenario)

pinochico

Of course,
you have to create new user group and setup ACL for app VirtueMart:

administrator/index.php?option=com_config&view=component&component=com_virtuemart

Order access
Orders edit
Orders delete
Order status change
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

GJC Web Design

Evan means if two admin have the same rights .. and no .. you can test this by opening a product edit in two separate browsers with 2 separate users .. both can edit..

the locked_on etc columns are there but are unused for this purpose
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

To GJC:
aha. Thanks for explanation

then if virtuemart don't use the same preventing system as joomla for editing articles, modules... you have to add by self develop.
If the collumn in DB now exist (and not used in this time), it should not be so difficult to implement.
Or you can add for these table for orders new collumn and all function in model order or view.html.php have to change.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Jörgen

This is not an Easy task. You have users that are updating the database att the same time. Checking in and out the order database during editing would interfere with normal order update from customers
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

EvanGR

In our experience, customers contact us directly when they want to change or cancel an order. But that's just us.

A proposal on how I think it could work:

1) In the default new order state, the order is available for editing but only by 1 person on the backend (enforced by the familiar lock mechanism).
OR... at least, show a notice that another user X has opened this order for editing at Y date/time.
So that employees can coordinate.

2) When the order status is changed to "Processing" (or equivalent), the customer can no longer edit their order. (Perhaps a "request cancellation" feature would be useful, but this should not change the order state directly)

Jörgen

You are missing my point.

If You put an lock on the database files related to the order management. You will also put a lock on product related files. This will stop new order from be registered if they are using any of the related database items. The amount of concurrent users will elevate the risk of conflicts. But it is enough for one customer to order one item that is on a locked order.

You can minimize the risk with transaction management where you encapsulate an update to make sure nothing interferes during read and write, but I do not see any easy way to make the conflicts zero. They will happen with unknown sideeffects.

The lock that is done for Joomla articles does work because front end users does not usually update the database files, content is mostly read.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

EvanGR

QuoteIn our experience, customers contact us directly when they want to change or cancel an order. But that's just us.

As can be seen from the answers below - this is not catered for.

Note - below here there is no solution, just observation.

May I suggest that you look at your business processes in the first instance - because I am struggling to envisage a scenario where a customer calls regarding their order and 2 people work on that in parallel.

That is not to say that it is not possible (of course it is!)

I could easily see how one person is working an order in detail view and another updates a load of statuses in list view and that "load" includes the order being worked on - That would be "interesting" .

It would also be a challenge to ensure that "if the locking of orders ever happened"  how the message was reflected to the user doing the status update - because (in my experience) users are really good at ignoring messages!!!
Regards
A

Joomla 4.4.5
php 8.1

EvanGR

By the way, just to make sure we are talking about the same thing....

I am not talking about database table locking.

I am only talking about marking an order as being already edited by a user (backend).

It should only take 2 DB columns to implement this: the last edit timestamp and the userid.
No hard locks or anything else.

Jörgen

Not easy to tell from Your posts what you want, this is in my eyes a 180 turn.

Last edited and edited by is already in the databse table. Override and edit Your BE view to show edited by.


Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

EvanGR

QuoteI am only talking about marking an order as being already edited by a user (backend).

It should only take 2 DB columns to implement this: the last edit timestamp and the userid.
No hard locks or anything else.

Yes understood - The "checked out" stuff similar to joomla

QuoteIt should only take 2 DB columns to implement this

The option to update this data on edit
The option to remove this data on closed /save
Modification to the order list display "being touched" status
The modification to the order edit display to show "being touched" status

This is likely to be a pain when a user opens an order - then just goes to another page without closing it "properly"
Functions to "clear this status on orders" that are definitely not being touched or open in edit

It is never a "It should only take" - so I am unsure who will take this forward and do the work for it.


This is a very specific request as it only works for an edit function - not for changing the status of an order in admin list that is being edited (which seems to me the most likely scenario)
Regards
A

Joomla 4.4.5
php 8.1

EvanGR

Thanks for the replies. Apologies if I am not 100% clear, English is a second language to me.

AH, thanks, that was exactly my thinking. Including the problems you pointed out.

Reminding the original problem:
Sometimes two employees open and process the same order at the same time. Because there is no indication that order is currently being processed by anyone else.

I would imagine this would be a common issue for any company that has 2+ employees working on the VM backend.

Jörgen

My personal guess is that this is not unique to VM. This is a common approach in many database systems around the world. Checking in and out views is not easy to handle. One of my early bosses called this kind of updating the "optimist method", last to save wins the edit, when two or more users are editing the same data. Not exclusive to VM in any way.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

QuoteI would imagine this would be a common issue for any company that has 2+ employees working on the VM backend.

For more than 9 years we have had more than 4 employees working on VM admin orders - but have yet experience a " double update" problem - so maybe it is a business process issue that can be solved by changing the business process?
Regards
A

Joomla 4.4.5
php 8.1

pinochico

heretical idea:

when it comes to jooma articles, Virtuemart orders should not be a problem.

But the right comment - is it even needed and will it be burned out financially?
Our one customer has 8 e-shops and the orders are always edited in the administration by one person so that there is no confusion.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products