2 replies [Last post]
hvitebjorn's picture
Offline
Joined: 07/26/2008
Juice: 85
Was this information Helpful?

The function uc_cart_complete_sale is called twice, and therefore the "checkout_complete" workflow event is invoked twice. Which decreases inventory each time.

I believe it is because uc_cart_checkout_complete is called first as a callback from the URL /cart/checkout/complete, which then calls uc_cart_complete_sale.

Then uc_cart_complete_sale is called directly from uc_paypal_ipn (around line 659) when the Instant Payment Notification comes through.

This is a big problem since inventory gets decreased twice, and any other events triggered by checkout_complete (referral bonuses) also happens twice.

I solved this quick and dirty by removing the latter call, but it doesn't seem ideal.

alanburke@drupal.org's picture
Offline
Joined: 08/05/2008
Juice: 82
Similar Issue

I stumbled across a similar issue over at
http://www.ubercart.org/forum/support/6887/checkout_confirmation_emails_...

As my module is based on the 2checkout module, it may be an issue there too.

You can see my approach to solving the issue there.

Alan

swelljoe's picture
Offline
Joined: 06/11/2009
Juice: 2
Re: Paypal express checkout invokes "checkout_complete" workflow

Has there been any update on this? I'm also running into this problem, where status "completed" is hit twice, causing two software licenses to be issued for each ordered product. I've made the change in the link provided by alanburke, but I haven't gotten an order yet to know if it does the job.