- 상태
- 개발자가 해결함
- 관련 플러그인/테마
- WooCommerce Checkout Field Editor
문제 개요
WooCommerce Checkout Field Editor 플러그인의 일부 문자열이 주문 확인 페이지나 고객사에게 발송되는 주문 이메일에서 번역되어 표시되지 않습니다.
임시 해결 방법
영구적인 수정을 위해 WooCommerce에 문의했지만, 아직 답변을 받지 못했습니다. 그동안 다음 임시 해결 방법을 사용하여 웹사이트의 문제를 해결할 수 있습니다:
- 웹사이트 파일과 데이터베이스를 백업하세요.
- woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php로 이동하세요.
- 681~690번 줄을 변경하세요.
변경 전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; }변경 후
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; }
