When sending a customer their invoice on a non-pending order, I get this
error in the logs:
PHP Fatal error: Uncaught Error: Using $this when not in object context in
wp-content/plugins/woocommerce/templates/emails/plain/customer-invoice.php:37
Stack trace:
#0 wp-content/plugins/woocommerce/includes/wc-core-functions.php(208): include()
#1 wp-content/plugins/woocommerce/includes/wc-core-functions.php(228): wc_get_template('emails/plain/cu...', Array, '', '')
#2 wp-content/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php(165): wc_get_template_html('emails/plain/cu...', Array)
#3 wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(502): WC_Email_Customer_Invoice->get_content_plain()
#4 wp-content/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php(130): WC_Email->get_content()
#5 wp-content/plugins/woocommerce/includes/class-wc-emails.php(338): WC_Email_Customer_Invoice->trigger(288402, Object(WC_Order))
#6 wp-content/plugins/woocommerce/templates/emails/plain/customer-invoice.php on line 37
referer: wp-admin/post.php?post=nnnnnn&action=edit
Change the "$this->object" reference to "$order" instead.