Conversation
supportHi i am making a custom email template and i want to remove it from email the details that adds the plugin i tried to do something like this but it doesnt work . Can you gave a hint pls ? if ( ! empty( $gateways[‘iris_payments’] ) && is_object( $gateways[‘iris_payments’] ) ) { remove_action( ‘woocommerce_email_before_order_table’, array( $gateways[‘iris_payments’], ’email_instructions’ ), 10 ); }
Ι found it just in case someone needs it add_action( ‘init’, ‘afentoulis_remove_iris_plugin_email_details’ ); function afentoulis_remove_iris_plugin_email_details() { // Αφαιρούμε τη συνάρτηση του plugin που τυπώνει IRIS details μέσα στο order details. if ( has_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’ ) ) { remove_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’, 10 ); } }
Sure, you found the right solution. The IRIS details are added to WooCommerce emails via the woocommerce_email_order_details hook (callback: irisgw_add_iris_payment_details ), so removing that action is the correct approach. For best compatibility, it’s recommended to run the removal after plugins are loaded , so the action definitely exists: add_action( ‘init’, ‘afentoulis_remove_iris_plugin_email_details’ ); function afentoulis_remove_iris_plugin_email_details() { if ( has_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’ ) ) { remove_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’, 10 ); } } Add it to your child theme (functions.php) or via a snippets plugin, and the IRIS payment details will no longer appear in the order emails. Marking this thread as Resolved . 👍
Ι found it just in case someone needs it add_action( ‘init’, ‘afentoulis_remove_iris_plugin_email_details’ ); function afentoulis_remove_iris_plugin_email_details() { // Αφαιρούμε τη συνάρτηση του plugin που τυπώνει IRIS details μέσα στο order details. if ( has_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’ ) ) { remove_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’, 10 ); } }
Sure, you found the right solution. The IRIS details are added to WooCommerce emails via the woocommerce_email_order_details hook (callback: irisgw_add_iris_payment_details ), so removing that action is the correct approach. For best compatibility, it’s recommended to run the removal after plugins are loaded , so the action definitely exists: add_action( ‘init’, ‘afentoulis_remove_iris_plugin_email_details’ ); function afentoulis_remove_iris_plugin_email_details() { if ( has_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’ ) ) { remove_action( ‘woocommerce_email_order_details’, ‘irisgw_add_iris_payment_details’, 10 ); } } Add it to your child theme (functions.php) or via a snippets plugin, and the IRIS payment details will no longer appear in the order emails. Marking this thread as Resolved . 👍