• Resolved HungryJos

    (@hungryjos)


    I’m using the Woocommerce Shipment tracking plugin to enter tracking numbers to orders. We added a custom code snippet, to automatically mark the order as completed when the tracking number is added.
    Since a few weeks, probably early september, this is no longer working as it should: the order is not getting marked ‘completed’ when adding the number, but when we remove the tracking number, it does change to completed.

    I know this is the woocommerce support, but I tested with an earlier version of the Shipment tracking plugin (1.6.8) and the problem is the same, which leads me to believe something has changed in woocommerce that makes that the code snippet no longer works.
    This is the code snippet

    function update_order_status_when_shipment_tracking_input( $meta_id, $object_id, $meta_key, $meta_value ){
        if( $meta_key == '_wc_shipment_tracking_items' ){
            error_log('update_order_status_when_shipment_tracking_input');
            $order = wc_get_order( $object_id );
            if( $order ){
                $order->update_status( 'completed' );
            }
        }
    }
    add_action( 'update_postmeta', 'update_order_status_when_shipment_tracking_input', 10, 4 );

    Has something chnaged in the way that woocommerce updates the order status?
    Or can someone tell me how I should update this snippet to make it work again?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there @hungryjos ??

    Has something chnaged in the way that woocommerce updates the order status?
    Or can someone tell me how I should update this snippet to make it work again?

    which leads me to believe something has changed in woocommerce that makes that the code snippet no longer works.

    Thanks for reaching out! From what I understand, this is about a custom code snippet that stopped functioning as expected.

    It would be of great help to know from which version WooCommerce was updated to which, then.

    The plugin’s changelog details a lot of fixes provided with version 7.0.0 alone, and many of the issues were related to orders naturally.

    Looking forward to hearing from you!

    • This reply was modified 2 years, 1 month ago by anastas10s. Reason: rephrase
    Thread Starter HungryJos

    (@hungryjos)

    It would be of great help to know from which version WooCommerce was updated to which, then.

    I’m using Woocommerce version 6.9.2

    Hi @hungryjos

    I’m using Woocommerce version 6.9.2

    OK, that’s good. And from which version of the plugin was it updated to 6.9.2?

    The changelog reveals 3 updates within 3 days, with version 6.9.0 bringing the most changes among them, for example.

    I’m using the Woocommerce Shipment tracking plugin to enter tracking numbers to orders.

    Furthermore, upon “googling” for this plugin I got various results, so I am unsure as to which one it is. Have you already got in touch with its developers to check its compatibility with about this?

    Last, but not least: this is about a custom code snippet, thus outside the scope of the support we are able to provide here. Please see our Support Policy.

    Were you able to get in touch with the developer of said custom code snippet?

    I hope that helps!

    • This reply was modified 2 years, 1 month ago by anastas10s. Reason: typo
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order status no longer changing when adding shipment tracking number’ is closed to new replies.