• Resolved miroslavnuvei

    (@miroslavnuvei)


    Hi to all!

    I found strange behavior of WC Block and just want to know is this normal. The test I made is as follow:

    Create an Order with some payment provider, I made test with COD and third party provider. When Order is completed be sure the status is Pending Payment. For COD I needed to change it manual, for the other plugin this is the default status, because the transaction is Authenticated and wait to be settled and paid.

    Then go to the Store and repeat the order, get the same item and finish the order. At the end I expect a new Order to be created in the admin, but instead WC override the previous order. For COD the status will be changed back to Processing and you will see two messages:
    “Payment to be made upon delivery. Order status changed from Pending payment to Processing.”

    If you change the status from Processing to Pending Payment the same will repeat.

    I want to know is this normal logic? And if it is, how I can force WC to create new Order and not to use last one in described scenario?

    Regards!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hey there, @miroslavnuvei! Thanks for contacting us. I’m happy to help you.

    This is not expected behavior, a new order should be created. Let’s investigate to figure out what is going on.

    I tried replicating this on my website, but couldn’t.

    I tried with both cash on delivery (setting it to pending payment as you mentioned) and with a payment gateway set to authorize and capture later.
    All orders had the same product and I used the same account.

    How did you recreate the order? Did you add the products on the cart again or did you use the order again option?

    Is this happening with all products?
    Is this happening if you use the checkout shortcode?

    This could be caused by a conflict, but before asking you to run a conflict test, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
    Fatal error logs (if any) under WooCommerce > Status > Logs. Then you can use the selector to search for Fatal Errors.
    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter miroslavnuvei

    (@miroslavnuvei)

    Hi and thanks for the replay!

    I made a video how I am reproducing the behavior. As you can see I deactivated all my plugins. Actually I spotted WC Subscriptions was active, so after I record the video I deactivated it also and reproduce the behavior again.

    There were some errors in the WC logs from yesterday, but this is normal for working site ?? at the end of the video I checked for new logs (2024-08-02), but there were any.

    The main step to reproduce the behavior is, after create the first order, to go in the Order view and change its Status to Pending Payment, and not to close the Store tab. I use same user for the admin and for the Store. After I return to the Store I select same product and finish the order with same settings.

    This behavior was found from a colleague of mine, I just reproduce it and made this topic here.

    I hope the video will help! The system report is here.

    Regards!

    Hey, @miroslavnuvei!

    Thank you for the video. I was able to replicate this on my website.

    But I wanted to understand the situation better.

    Do you mind sharing why do you want to set the orders to the pending payment status?

    As explained in the documentation, the pending payment status: The order has been received, but no payment has been made. Pending payment orders are generally awaiting customer action.

    This should only be used if there’s no payment intent yet.

    For example, you mentioned the payment gateway you use the transaction is Authenticated and wait to be settled and paid. This means the order should have the “on hold” status not pending payment.

    Orders with offline payment, such that can’t be immediately confirmed should also be set as on hold, not pending payment.

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter miroslavnuvei

    (@miroslavnuvei)

    Hi!

    I am glad you was able to reproduce it! Now you can handle this.

    About my case. Since few years (probably since WC v 3.0) I work in a team who develop and support a third party payment plugin. It has two payment flows – direct Sale, where the transaction is authorized and money are captured; the other flow is so called Auth, where the transaction and the client card are only authorized. For the Sale Orders we set status Completed by default, for Auth Orders we set Pending Payment, because the merchant have to go in the Order view and click on a custom Settle button to complete the process.

    From our (team) point of view the more logical status is Pending Payment, we never used On-Hold, it just not sound right for our case. And if we change the status this my confuse the merchants who use our plugin.

    As this case is limited and if you have plans to change WC Block behavior we prefer to keep our logic. (By the why the plugin has options those statuses to be changed, so the merchant can set On-Hold status for Auth transacions).

    Any way we will discus your recommendation for the authorized payments and their status. Any additional information from your site is welcome!

    Regards!

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @miroslavnuvei

    Thank you for sharing further details.

    It seems that your and @carolm29 ‘s luck is better than mine, because I haven’t been able to replicate this issue using the latest version of WooCommerce. I’ve tested it on an old installation, a new installation, a dev site, and even a live site. Here are the steps I’ve followed:

    • Order a product using COD and change the order status to pending payment.
    • Then again order either same or different product and check the order.

    The behavior you described is indeed not the norm. Each new order should create a separate entry in the admin, regardless of the payment method or order status.

    However, since you see that the previous order is being overridden, this suggests that there might be a conflict somewhere in your setup.

    To troubleshoot this, try reproducing the issue using a default WordPress theme like Twenty Twenty-four or Storefront. Make sure no custom code or customization is added.

    Additionally, head over to WooCommerce → Status → Tools, and do the following:

    • WooCommerce transients – Clear
    • Expired transients – Clear
    • Clear template cache – Clear
    • Capabilities – Reset Capabilities
    • Clear customer sessions -Clear
    • Product lookup tables – Regenerate
    • Regenerate the product attributes lookup table – Regenerate

    Next, please clear your browser and server cache and then try again.

    If the issue continues even with all plugins deactivated and a default theme active, please enable WP Debug mode and share a copy of any fatal error log found under WooCommerce → Status → Logs.

    You could copy and paste your reply or share it via Mozilla Community Pastebin and share the link here.

    Furthermore, please note that changing the status from Processing to Pending Payment could potentially cause issues, as WooCommerce uses these statuses to manage the workflow of orders. It’s generally recommended that WooCommerce handle status changes automatically based on the payment method and order progress.

    Looking forward to hearing from you!

    Thread Starter miroslavnuvei

    (@miroslavnuvei)

    Hi!

    I made a clean install on my localhost with WP 6.6.1 and WC 9.1.4. I didn’t touch anything in the site, just imported the products from WC folder, and enable COD.

    I clear all mentioned settings and repeat. Create an order, went into admin Order details and changed to Pending Payment. I didn’t close the tab with the Store. In the store from the Thank you page, clicked on product in the finished order, added it again and finish the order. This reproduce the described problem.

    Keep in mind if you change the product, WC will create new order. Just keep everything as the first order.

    There were no error logs (I have some problem with attaching the image):

    https-woocommerce-com-wp-json-wccom-obw-free-extensions-4-0-extensions-json2024-08-052024-08-05 12:28:42287 KB Select the August 5, 2024 log file for https-woocommerce-com-wp-json-wccom-payment-gateway-suggestions-2-0-payment-method-promotions-json https-woocommerce-com-wp-json-wccom-payment-gateway-suggestions-2-0-payment-method-promotions-json2024-08-052024-08-05 12:28:42179 KB Select the August 5, 2024 log file for https-woocommerce-com-wp-json-wccom-payment-gateway-suggestions-2-0-suggestions-jsoncountrybg https-woocommerce-com-wp-json-wccom-payment-gateway-suggestions-2-0-suggestions-jsoncountrybg2024-08-052024-08-05 12:28:3899 KB Select the August 5, 2024 log file for log log2024-08-052024-08-05 11:51:4176 B Select the August 5, 2024 log file for https-woocommerce-com-wp-json-wccom-inbox-notifications-2-0-notifications-json https-woocommerce-com-wp-json-wccom-inbox-notifications-2-0-notifications-json2024-08-052024-08-05 11:44:381 KB Select the August 5, 2024 log file for https-woocommerce-com-wp-json-wccom-payment-gateway-suggestions-2-0-suggestions-jsoncountryus https-woocommerce-com-wp-json-wccom-payment-gateway-suggestions-2-0-suggestions-jsoncountryus2024-08-052024-08-05 11:41:252 KB

    As you recommended we will change the WC Status for our Authenticated transaction from “Pending Payment” to “On-hold”.

    Regards!

    • This reply was modified 3 months, 3 weeks ago by miroslavnuvei.
    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @miroslavnuvei

    Thanks for the further update and information.

    After doing some more testing, I was able to reproduce the error. I suspect it is due to cookies and cache since we are placing orders using the same user ID and the same product within a few time intervals.

    I would recommend submitting a bug report to our developers. You can create a new issue on the WooCommerce GitHub repository. Please provide as much detail as possible, including the steps you’ve taken to replicate the issue.

    Make sure to include a link to this thread, so they know what has been done already.

    In the meantime, you can change the status for your authenticated transactions from “Pending Payment” to “On-hold”. This should help avoid any potential issues with the order workflow.

    I wish I could help more, but hopefully, this provides some clarity. Please let us know if you have any other questions!

    Thread Starter miroslavnuvei

    (@miroslavnuvei)

    Thank you for your time guys!

    We already changed our status and I will report the problem in GitHub.

    Regards!

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @miroslavnuvei

    We’re glad to hear that you’ve already changed your status and plan to report the issue on GitHub. Your proactive approach is very much appreciated. We believe that your detailed report will help our developers to understand and address the problem thoroughly.

    Remember, the more detailed your report, the easier it will be for our developers to replicate the issue and find a solution. So, don’t hesitate to include all the steps you’ve taken, this thread link, any error messages you’ve received, and any other relevant information.

    Meanwhile, I will mark this thread as resolved. Should you have further inquiries, kindly create a new topic here.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.