Ilya Kochkin2019-05-26 09:45:47
Ilya Kochkin, 2019-05-26 09:45:47

500 error occurs when placing an order, how to avoid?

Good afternoon, I use the hook - woocommerce_email_after_order_table, in order to do a little integration with the crm system, there is a small self-written class crm.php
before executing the hook, I connect this class

add_action( 'woocommerce_email_after_order_table', 'custom_email_after_order_table', 99, 4 );
function custom_email_after_order_table( $order, $sent_to_admin, $plain_text, $email ) {
  $crm = new crm();

the class is connected correctly was checked on another hook, but when executing a piece of code , a 500 error occurs, what's the catch?
$crm = new crm();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question