Woocommerce checkout process creating new order at payment

允我心安 提交于 2019-12-12 02:45:13

问题


I'm having a problem with WordPress/Woocommerce creating a second order for customers. This is leading to a couple issues that I'll outline below. Here is the process I am following:

  1. Create and populate new Woocommerce Subscription object
  2. Create new renewal order (this will be ID 1033 below) and send invoice to customer
  3. Customer logs in and finds the pending order in My Account page
  4. Customer opens the pending order and it is populated with the correct products and price. Customer pays the correct amount
  5. After payment, customer is on the receipt screen but it is for a new order. The old order is still sitting on their account as pending.

After looking at the access log, I can see this:

  • Here is the entry link (pre-payment): /checkout/order-pay/1033
  • And here is the review link (post-payment): /checkout/order-received/1055

The problems I am encountering are:

  • I have tested completing payments more than dozen times and was only able to replicate it the first time. I have followed those same steps as much as possible to no avail (all other transactions are processing as expected without creating extra orders)
  • The initial order is connected to a subscription, and upon completed payment the subscription is set to automatic payments. This issue of having a new order is detaching it, and automatic payments cannot be enabled until after the next payment is processed (a month later), and will rely on the customer manually submitting the order again.

Does anyone have any idea why WordPress/Woocommerce is creating a second order upon payment.


回答1:


I was having the same issue with renewal payments getting applied to a new order. In my case, I was consistently having this issue with manually added subscriptions, as well as with imported subscriptions.

After working with Woocommerce Subscriptions Support, they came out with an update (version 2.1.0) solving the issue for me. Their change log references the fix.

Fix: Do not create new orders when processing a renewal and resubscribe payment with different details to the original order by ensuring the cart hash used by WooCommerce is updated when creating the order. (PR#1687)

Try updating Woocommerce Subscriptions to version 2.1.0.



来源:https://stackoverflow.com/questions/40370911/woocommerce-checkout-process-creating-new-order-at-payment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!