ナビゲーションをスキップする

Resolved by author

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;
    }
    

返答する

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

これらのタグを使用できます:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>