When a payment is entered the system sends out a new order mail as well.

This was not happening on the version of september 1st...

Not sure what triggers the rules....

Comments

bwynants’s picture

this only happens for existing orders!

new orders are fine...

uc_cart_complete_sale triggers uc_checkout_complete event when $order->data['complete_sale'] is empty....

guess complete_sale was not there before....

longwave’s picture

This was part of the fix for #1192018: Duplicate order notification e-mail, and duplicate stock decrement

I hadn't considered existing orders like that; most orders receive payment shortly after being made, but I guess in the case of check payments that isn't necessarily the case. Are you using checks or another payment method here?

bwynants’s picture

yes, i fixed the database and set complete_sale as logged_in for all my existing orders....

update uc_orders set data = 'a:1:{s:13:"complete_sale";s:9:"logged_in";}' where data = 'a:0:{}' and order_status != 'in_checkout'

and a few more querys like that...

that will fix it ....

longwave’s picture

I think this will also happen if you create a new order from the admin side, then enter a payment against it.

mitrpaka’s picture

Fix for #1192018: Duplicate order notification e-mail, and duplicate stock decrement causes similar type of regression in 6.x-2.7 for all payment methods where payment is entered the system before calling uc_cart_complete_sale() function.

As a result of that new order mail and stock is decreased twice. 1st time when entering payments using uc_payment_enter() and 2nd time when uc_cart_complete_sale() called.

Quick workaround for this seems to be either commenting out uc_cart_complete_sale($order); line from uc_payment_enter() function (that was added part of the fix) or call uc_cart_complete_sale_account($order) function instead (in order to ensure that user account created before payment is made)

   // Ensure user has an account before payment is made.
   uc_cart_complete_sale_account($order);
longwave’s picture

Status: Active » Postponed (maintainer needs more info)

#5 is untrue, SimpleTests prove this; appears it was a problem in 2Checkout (and derived modules) only.

Closing as duplicate of #1340782: In 6.x-2.7 entering payment now causes email to be sent out which is more detailed.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Fixing status