Fixing Shipment Tracking & WooCommerce Subscriptions issues

If you use WooCommerce you probably know Subscriptions, that awesome plugin that allows anyone to sell subscriptions. Today, I had a ticket about an issue between Suscriptions and Shipment Tracking, a great extension to track your shippings.

Here is what the customer was facing:

I’ve been using Shipment Tracking with Subscriptions for a while now, and every month I run into the same problem with shipment tracking. If I add shipment info in January for the order that month, the email goes out correctly to the customer with the tracking info.

But if I don’t manually remove the tracking info and set it back to “Custom Provider” before the renewal purchase order is placed, the renewal order email that goes to the customer includes the old tracking info at the top and it’s very confusing.

After a quick talk with guys from Skyverge (thanks Matt!),  we came up to a nice solution to fix small issue between these two great plugins. The following code snippet will stop the unwanted tracking meta from transferring from the previous subscription order to the new renewal order. You will need to change the _tracking_meta_key within the code below to reflect the exact tracking meta key stored in the database for this to work properly. And boom (don’t forget: this snippet needs to be added in functions.php in the theme folder)!

5 responses to “Fixing Shipment Tracking & WooCommerce Subscriptions issues”

  1. anu

    Oh, thanks so much! I have been facing this issue for a few weeks myself too!

    I tried to copy/paste this but got an error for line 11: “error: Parse Error: Syntax error, unexpected T_PUBLIC, expecting EOF”

    How can I fix it?

    Thanks!

    1. Hey, I just fixed the snippet, it should ok now ;-)

      1. anu

        Thanks for the quick reply! But I’m still getting the same error…sorry!

  2. suyog

    Hi – I’m working with Anu, facing the same issue again when adding to functions.php.

    When I removed the public identifier for the function, the error went away, however it looks like there’s a syntax error on the add_filter line as well.

    Also can you help with what table I can find the “_tracking_meta_key” for my site? Thanks!

  3. wtjohnson

    This is exactly what I need, thanks for tackling this issue! I have a newbie question though- I’m not familiar with “_tracking_meta_key” and I don’t see it explicitly within my DB. Is there a resource you could point me to in order to better understand where to find that? Thanks!

Leave a Reply