WPML
Status
Resolved by author
Related plugin/theme
WooCommerce Checkout Field Editor

Overview of the issue

Some of the strings from WooCommerce Checkout Field Editor plugin do not appear as translated on the order confirmation page or the order emails sent to the client.

Workaround

We’ve contacted WooCommerce for a permanent fix, but have yet to hear back. In the meantime, you can use the following workaround to fix the issue on your website:


  1. Backup your website files and database.

  2. Navigate to woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php

  3. Change lines 681 to 690
    From
    function wc_get_checkout_field_value( $order, $name, $options ) {
    	$order_id    = version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id();
    	$field_value = get_post_meta( $order_id, $name, true );
    	if ( 'checkbox' === $options['type'] && '1' === $field_value ) {
    		$field_value = __( 'yes', 'woocommerce-checkout-field-editor' );
    	}
    	return $field_value;
    }

    To

    function wc_get_checkout_field_value( $order, $name, $options ) {
    	$order_id    = version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id();
    	$field_value = get_post_meta( $order_id, $name, true );
    	if ( array_key_exists( $field_value, $options[ 'options' ] ) ) {
    		$field_value = $options[ 'options' ][ $field_value ];
    	}
    	if ( 'checkbox' === $options['type'] && '1' === $field_value ) {
    		$field_value = __( 'yes', 'woocommerce-checkout-field-editor' );
    	}
    	return $field_value;
    }

All known issues →