Ajax For Better Stock Management?

As our shop grew, we now often have multiple people updating and editing products at the same time. With people ordering at the same time. This creates situations that make the stock amounts incorrect. Example:

Someone is editing the text of a product, keywords, etc. This takes 20 minutes.

At the same time, someone orders the product 3 times.

Now, the person editing the product text hits save. The stock is now back at its old value, meaning there are 3 products too many in the system.

Since we started to use a 2nd storefront for wholesale, this problem grew even larger, because the quantities ordered are much higher and our stock is now sometimes way off.

Now I had the idea, maybe we could make it so that stock quantities are updated immediately if someone changed the quantities (using ajax?). This would then also need to show on the page another person has open so that the correct quantity is being saved. Would something like this be possible? Or does anyone have other ideas? I'd be very happy to hear it.

Thanks!

As our shop grew, we now often have multiple people at the same time who updating and editing products. With people ordering at the same time. This creates situations that make the stock amounts incorrect. Example:

Someone is editing the text of a product, keywords, etc. This takes 20 minutes.

At the same time, someone orders the product 3 times.

Now, the person editing the product text hits save. The stock is now back at its old value, meaning there are 3 products too many in the system.

Since we started to use a 2nd storefront for wholesale, this problem grew even larger, because the quantities ordered are much higher and our stock is now sometimes way off.

Now I had the idea, maybe we could make it so that stock quantities are updated immediately if someone changed the quantities (using ajax?). This would then also need to show on the page another person has open so that the correct quantity is being saved. Would something like this be possible? Or does anyone have other ideas? I'd be very happy to hear it.

Thanks!

Hello,

What would be a better solution is to detect what fields are actually 'changed' in the backend, and update those accordingly. I have mentioned this to CS-Cart numerous times but they neglect to implement such a system since it requires to much refactoring.

Another good example of this would be the create order system. If you create a 3 new orders (in new tabs, don't save them), and you change start changing stuff in all those orders, you will notice that it starts corrupting the data in each order.

Besides these 2, there are plenty of other scenarios where this is the case. Anyhow, we would be glad to apply said changes for you. Please contact us at sales@poppedweb.com

Kind regards,

Hello,

What would be a better solution is to detect what fields are actually 'changed' in the backend, and update those accordingly. I have mentioned this to CS-Cart numerous times but they neglect to implement such a system since it requires to much refactoring.

That would already help a lot, although potentially it would still be possible that 2 people edit the same quantity at the same time. But I think it would fix 98% of the problems. Or what about a "lock" on the quanties fields, so that the quantities are only saved when unlocked. I guess that would be easier to implement?

That would already help a lot, although potentially it would still be possible that 2 people edit the same quantity at the same time. But I think it would fix 98% of the problems. Or what about a "lock" on the quanties fields, so that the quantities are only saved when unlocked. I guess that would be easier to implement?

Yes, you could implement a product updating lock to prevent these updates. Although, problems do arise when you consider that users can exit the product updating page immediately. Which can result in a temporary lock till the max expiry time, which will have to be set at like 20 minutes or something.

I added it to the bugtracker. Support is very welcome: https://forum.cs-cart.com/tracker/issue-7540-stock-management-impossible-with-cs-cart/

Yes, you could implement a product updating lock to prevent these updates. Although, problems do arise when you consider that users can exit the product updating page immediately. Which can result in a temporary lock till the max expiry time, which will have to be set at like 20 minutes or something.

I think maybe you misunderstood me. I simply meant a little unlock button next to the stock quantity, which you have to open if you want to edit stock. If you just want to edit text, you can leave it locked and edit + save as usual.

It would function the same as the icon you use to save something, like an option, for all stores instead of just for the owner store. See image attached. See:

4ijEWnuNFsk7.png