Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to unhook woocommerce_email_after_order_table #99

Closed
arminreh opened this issue May 9, 2017 · 6 comments
Closed

How to unhook woocommerce_email_after_order_table #99

arminreh opened this issue May 9, 2017 · 6 comments
Assignees

Comments

@arminreh
Copy link

arminreh commented May 9, 2017

Hi,

I'm trying to remove the Payment notice in the emails with uncertain Payment status. It is hooked here.
https://github.com/mollie/WooCommerce/blob/master/mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstract.php#L70

How can I unhook the method in my theme?

@arminreh
Copy link
Author

@tom-mollie any chance you can help me with this?

@tom-mollie
Copy link
Contributor

Hi @afeistenauer ,

Sure! First question: Have you tried adding a remove_action() with the correct parameters in your theme?

See: https://codex.wordpress.org/Function_Reference/remove_action

That should probably work. If not, please let me know, and I'll try setting this up locally.

Best regards,
Tom

@tom-mollie tom-mollie self-assigned this May 15, 2017
@davdebcom
Copy link
Contributor

@afeistenauer Did you manage to do this?

@arminreh
Copy link
Author

Hey @davdebcom I implemented it like this:

function my_remove_mollie_payment_status_message_in_mails(){
global $gateway;
remove_action('woocommerce_email_after_order_table', array($gateway, 'displayInstructions'), 10);
}
add_action( 'woocommerce_email_after_order_table', 'my_remove_mollie_payment_status_message_in_mails', 1, 0);

Tricky part was finding out about how to access the correct gateway by using the global $gateway object.

@davdebcom
Copy link
Contributor

Thank you, added it to this page!
https://github.com/mollie/WooCommerce/wiki/Helpful-snippets

@artifex-media
Copy link

artifex-media commented Oct 12, 2022

Thank you, added it to this page! https://github.com/mollie/WooCommerce/wiki/Helpful-snippets

@tom-mollie This snippet no seems to longer works (latest versions of all WP, WooCommerce and Mollie plug-in)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants