Created
July 23, 2019 11:35
-
-
Save zorem/97f8b731fcb73409db74b73ff26ac6d5 to your computer and use it in GitHub Desktop.
Do not show information of the plugin “Shipment Tracking” in invoice PDFs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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