• Resolved kfomichev

    (@kfomichev)


    Hi! In our shop we noticed orders occasionally reverting their statuses to defaults. Even after some days after placement, or even completed orders.

    In the plugin settings we set default custom order status as “to be confirmed by operator”. For new order the plugin correctly assigns this default status and sends user notification email. After confirmation the order is being processed. While being processed we change its status several times, like “packaging”, “shipped”, “received” etc. The problem is, if the user reloads the order thank-you page (/checkout/order-received/1234//?key=wc_order_…) at any moment, the plugin is triggered as if it was a new order and reverts its status to default, regardless of current progress. Sometimes the thank-you page remains open on user’s device and reloads after browser restart (or waking up from sleep), even after several days.

    I guess, that’s because you use ‘woocommerce_thankyou’ action hook for setting default status. This action is fired every time the thank-you page loads.

    This causes much confusion, users receive duplicate notifications for orders they placed several days ago, or even already picked up.

    Each order should be processed only once. Maybe, you could somehow flag the order after setting the default status for the first time and check the flag on every event, preventing subsequent status reset.

    Thank you very much, I hoope you could resolve this ASAP.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thanks for sending in your support topic.

    Our team will be looking into things shortly. For faster and better support, please provide your WooCommerce Status Report (provide link to the instructions on WooCommerce), screenshot, error info, and visit our site’s support section for additional help. Due to forum policies, we are not able to share any credentials, provide files/patches, or sensitive information.

    Thank you,

    Alfred

    Plugin Author Kleinmann

    (@kleinmannbrightvessel)

    Hello @kfomichev,

    Thank you for your feedback, we appreciate it !
    We will check it

    – Best Regards

    Thread Starter kfomichev

    (@kfomichev)

    Thnk you very much.

    Menwhile I found a workaround, I modified the Checkout.php file, public function set_default_order_status( $order_id ) . I wrapped the main action into an if ($order->has_status('processing') ) . This works for me, because all new orders on my site get “processing” status first after creation. This might not work for others, who use pre-payment or other settings. Best way would be to set a small metadata flag after the plugin has processed the order, then chack this flag before processing again to avoid double processing.

    public function set_default_order_status( $order_id ) {
    if ( !$order_id ) {
    return;
    }
    $order = wc_get_order( $order_id );
    if ($order->has_status('processing') ) {
    $payment_method = $order->get_payment_method();
    $option_prefix = 'orderstatus_default_statusgateway_' . $payment_method;
    $defaultStatus = get_option( 'wcbv_status_default', null );
    if ( $defaultStatus ) {
    if ( isset( $defaultStatus[$option_prefix] ) && 'bpos_disabled' !== $defaultStatus[$option_prefix] ) {
    $order->update_status( $defaultStatus[$option_prefix] );
    } elseif ( isset( $defaultStatus['orderstatus_default_status'] ) && 'bpos_disabled' !== $defaultStatus['orderstatus_default_status'] ) {
    $order->update_status( $defaultStatus['orderstatus_default_status'] );
    }
    }
    }
    }
    shahidbrightvessel

    (@shahidbrightvessel)

    Hello @kfomichev

    Thank you for bringing this issue to my attention. I’ve thoroughly checked the implementation on our side, including the COSM Plugin, and can confirm that there is no issue with the thank you page or any related hooks from our end.

    Given your description, it seems the issue could be related to a specific payment method setting, addon, or plugin that’s potentially updating the order meta data. I suggest disabling the suspected plugins or addons and testing the thank you page again to see if the issue persists. If the problem still occurs after doing so, please let me know and I’ll be happy to assist further.

    Looking forward to your feedback.

    Best regards,

    Plugin Support mathdaniel

    (@mathdaniel)

    Hello,

    I hope you are well.

    As we haven’t received a recent response, I’ll mark this as resolved. Feel free to open a new ticket if you continue encountering issues or reopen this ticket.

    We’d be happy to assist. Thank you!

    Best regards, peace!

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