php - I want to stop order complete notification for local-pickup in wp-woocommerce -


i want stop order complete notification local-pickup in wp-woocommerce code in child theme function.php not working please me ...

function wc_stop_order_notification( $email_class ){      global $post;      $order = new wc_order($post->id);      $wc_oreder_status = $post->post_status;      $shiping_method_used_in = $order->get_shipping_method();       if( $shiping_method_used_in == 'local pickup' && $wc_oreder_status == 'wc-completed'){          remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['wc_email_customer_completed_order'], 'trigger' ) );     } } add_action( 'woocommerce_email', 'wc_stop_order_notification' ,99); 

'woocommerce_email' may not work. use hook 'woocommerce_order_status_completed' instead.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -