In order to use a different template based on an order variable, simply add the following filter to your themes functions.php
You can, for example, change the function to use a different template based on the payment method instead.
/** * Change template based on WPML order language. * Make sure to create custom templates with the correct names or the templates won't be found. * * @param string $template_name template name. * @param string $template_type template type like global or simple. * @param int $order_id WC Order ID. * * @return string */ function change_template_based_on_order_language( $template_name, $template_type, $order_id ) { $order_language = get_post_meta( $order_id, 'wpml_language', true ); if ( false === $order_language ) { return $template_name; } switch ( $order_language ) { case 'en': $template_name = 'minimal-en'; break; case 'nl': $template_name = 'minimal-nl'; break; } return $template_name; } add_filter( 'wpi_template_name', 'change_template_based_on_order_language', 10, 3 );