stock level decreased for failed order submitting

Project: 
Ubercart
Category: 
bug report
Priority: 
normal
Status: 
fixed

Hi,

I just noticed that when an order is submitted, but fails (the credit card is expired, for example) the stock levels for the products being order are still decreased. So a customer who tries to submit their order several times could end up reducing stock levels several times. I'm not sure if there's an easy fix for this, but thought I'd point it out.

Best,
Chad

Re: stock level decreased for failed order submitting

Which module are you using for stock tracking?

uc_stock Should I have

uc_stock

Should I have considered a different one?

Re: uc_stock Should I have

No, uc_stock is good. I was asking because I've taken on responsibility for the Inventory module, which also tracks stock, so I wanted to see if this was something that I personally had to deal with.

uc_stock is core, and Shawn is the one to address the issue.

Re: Re: uc_stock Should I have

Right, the idea behind have the stock levels decrement at order submission is to reserve stock for orders so that anyone who places an order has been assured that there is stock for that order. Depending on your business logic, you may or may not want to do this. Anyway, it's become apparent now we must have a more configurable way to adjust stock levels. I think this is a candidate for workflow integration. This way store administrators can configure where to adjust stock levels (order submission, payment received, order completion, etc.).

Re: Re: Re: uc_stock Should I have

Okay, that makes sense. For my purposes the current system works pretty well, so I didn't want to create a lot of work here. I just wanted to point out that I saw a single order result in stock levels decreasing 3 times. For anyone trying to track their inventory carefully, this means it could become out-of-synch. I'm just using it as a warning that inventory is getting low, not precise tracking so it is not a big deal for me.

Thanks,
Chad

Re: Re: Re: uc_stock Should I have

To follow up here, the uc_stock module now uses a default workflow configuration to implement stock adjustment upon completion of an order. This can configuration can be turned off using the Workflow-NG UI.