Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Ajax For Better Stock Management? Rate Topic   - - - - -

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2286 posts

Posted 26 May 2019 - 08:49 AM #1

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!


When life hands you lemons, bring on the Tequila baby!


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 512 posts

Posted 26 May 2019 - 10:57 AM #2

 

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,


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2286 posts

Posted 26 May 2019 - 02:30 PM #3

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?


When life hands you lemons, bring on the Tequila baby!


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 512 posts

Posted 27 May 2019 - 05:25 AM #4

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.


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2286 posts

Posted 29 May 2019 - 05:22 AM #5

I added it to the bugtracker. Support is very welcome: https://forum.cs-car...e-with-cs-cart/


When life hands you lemons, bring on the Tequila baby!


 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2286 posts

Posted 29 May 2019 - 05:28 AM #6

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


When life hands you lemons, bring on the Tequila baby!