Closed (fixed)
Project:
Ubercart
Version:
5.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2008 at 20:25 UTC
Updated:
8 Jun 2009 at 14:17 UTC
Please see attached screenshot. A single hat was purchased yet uc_stock decremented the stock twice.
This purchase was made on a production site so I would appreciate a quick fix if possible.
I am using DRupal 5.5 with PostgreSQL.
| Comment | File | Size | Author |
|---|---|---|---|
| Order74.PNG | 61.83 KB | WISEOZ |
Comments
Comment #1
rszrama commentedI believe this is because the uc_cart_complete_sale() is getting called twice accidentally. You can try to fix this by adding a condition to the decrement stock workflow configuration that checks the order status or balance or something else to make sure it only fires once.
If this works, please mark this issue as fixed and I'll make sure this is mentioned in the documentation.
Comment #2
WISEOZ commentedThat appears to work. I added a "check the order status" condition. Thanks!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
frost commentedDrupal 5.10 with Ubercart 1.4 , running Paypal in sandbox. I get double stock decrements as described above, however adding criteria to the workflow rules doesn't help, see reasons below:
The order flow is as follows:
User submits order from Ubercart - order status is "in checkout"
User click "Pay" on Paypal - order status is updated to "Payment received", balance is reduced to zero, and THEN the stock is decremented
User returns to Ubercart/Drupal site - stock is reduced again
Based on this, I can't see what criteria to add to the workflow rule to make this distinguish between the first and second time. When the stock is decremented the first time, the order status is "Payment receieved" and the balance is zero. The second time it decrements stock, the order status and balance are identical.
Comment #5
frost commentedI've come up with a working solution:
-disable the original workflow rule, but add an action to it, to either email or add a watchdog entry, to be sure I know if it fires (some reports were that it fires even if disabled)
-create a new workflow rule as follows:
Invoked on Event: A payment gets entered for an order
Condition: Order balance <=0 (this was to prevent a partial payment from triggering this)
Action: Decrement stock
Comment #6
bbzed commentedim using paypal as well as direct deposit, solving this issue the way frost suggests will not work for direct deposit purchases
Comment #7
bbzed commentedSOLVED: i made a rule to decrease stock when order status is changed to payment cleared on a direct deposit order
me=slow