Restore New Order emails to admin in WooCommerce bug caused by WPML

PHOTO EMBED

Tue May 23 2023 19:50:17 GMT+0000 (Coordinated Universal Time)

Saved by @lancerunsite #wordpress #wpml #woocommerce #new #order #email

	<?php
// 	if ( $sent_to_admin ) {
// 		$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
// 		$after  = '</a>';
// 	} else {
// 		$before = '';
// 		$after  = '';
// 	}
	
	$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
	$after  = '</a>';
	
content_copyCOPY

I had exactly the same issue, and I've solved it by editing the woocommerce/templates/emails/email-order-details.php file: in lines 25-35 I've removed the if condition entirely and emails now work again.