Skip to content

Instantly share code, notes, and snippets.

@zorem
Created July 23, 2019 11:35
Show Gist options
  • Save zorem/97f8b731fcb73409db74b73ff26ac6d5 to your computer and use it in GitHub Desktop.
Save zorem/97f8b731fcb73409db74b73ff26ac6d5 to your computer and use it in GitHub Desktop.
Do not show information of the plugin “Shipment Tracking” in invoice PDFs
<?php
// Add this code to your theme functions.php file or a custom plugin
if ( class_exists( 'zorem_woocommerce_advanced_shipment_tracking' ) ) {
add_action( 'wp_wc_invoice_pdf_start_template', function() {
$tracking_actions = $GLOBALS[ 'WC_advanced_Shipment_Tracking' ];
remove_action( 'woocommerce_email_before_order_table', array( $tracking_actions, 'email_display' ), 0, 4 );
});
add_action( 'wp_wc_invoice_pdf_end_template', function() {
$tracking_actions = $GLOBALS[ 'WC_advanced_Shipment_Tracking' ];
add_action( 'woocommerce_email_before_order_table', array( $tracking_actions, 'email_display' ), 0, 4 );
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment