• Resolved drjx

    (@drjx)


    How can I remove the “Tracking” section from our Order Shipped emails to customers?

    We use “Advanced Shipment Tracking for WooCommerce” which adds one and we don’t want 2 different tracking sections.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello drjx,

    Thank you for contacting WooCommerce support.

    Could you please share a screenshot of the “Tracking” section you want to remove? This will help ensure we’re on the same page.

    Looking forward to your response. ??

    Best regards.

    Thread Starter drjx

    (@drjx)

    Thank you.

    We need to remove the 2nd one, where it says “Tracking” (between order items table and addresses).

    Hello drjx,

    Thank you for your reply.

    WooCommerce by default doesn’t provide a built-in option to modify the email templates, including removing the “Tracking” section.

    Since you’re using the “Advanced Shipment Tracking for WooCommerce” plugin, and you want to avoid having duplicate tracking sections, this will require some custom code to modify the email templates.

    As custom coding falls outside our support scope, I recommend consulting with a professional web developer to help you adjust the email template as needed.

    Let me know if you need further guidance or recommendations!

    Best regards.

    Thread Starter drjx

    (@drjx)

    So just to confirm, having me: setup, grab, redact, host, and post a screenshot was of no use whatsoever? Not nice! But ok, moving on…

    Since this section is being added by WC Shipping, can you tell me the name of the function call it adds so I can remove it.

    Thread Starter drjx

    (@drjx)

    I grepped the source code and found the hook. It’s added in the file: wp-content/plugins/woocommerce-shipping/src/Loader.php

    with this line: add_action( ‘woocommerce_email_after_order_table’, array( $this, ‘add_tracking_info_to_emails’ ), 10, 3 );

    Obviously, I don’t want to edit the woocommerce shipping source code (although I get what I want if I comment out the line). I’d like to try to remove the hook (in my functions.php) with something like:

    remove_action( ‘woocommerce_email_after_order_table’, array( $this, ‘add_tracking_info_to_emails’ ), 10, 3 );

    But I need to figure out the object context to replace “$this”.

    Can anyone help?

    Plugin Author Gerhard Potgieter

    (@kloon)

    Hi @drjx

    Unfortunately the context of the class in not done in a way that would enable you to override the action. We have just added a new filter wcshipping_email_tracking_info that any third party plugin can use from version 1.1.5 to override if the tracking info should show in the email.

    We are aiming to launch 1.1.5 this week.

    Thread Starter drjx

    (@drjx)

    Wow! Thank you!!! A filter was a great idea. So, just pass back a true/false? (Is there a list of wc shipping hooks?)

    Plugin Author Gerhard Potgieter

    (@kloon)

    Just an update, we decided to rename the filter to wcshipping_include_email_tracking_info, and yes you just pass a true or false to it if you want to have it display or not.

    // Do not include WooCommerce Shipping tracking info in emails.
    add_filter( '
    wcshipping_include_email_tracking_info', '__return_false' );

    We’ll work on documenting all available actions and filters in one of the upcoming releases, thanks for that suggestion.

    Thread Starter drjx

    (@drjx)

    Perfect. Thanks again Gerhard.

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