L
L
ligisayan2019-06-13 17:41:00
WordPress
ligisayan, 2019-06-13 17:41:00

Why textarea signature is not localized through woocommerce filter?

Hello!
There is a shop on woocommerce where it is necessary to make labels (signatures) of biiling fields multilingual. I use the polylang plugin for this .
Interestingly, the captions of billing fields with the input selector are translated without problems, but the caption of the textarea of ​​the order section is no longer translated - why?
functions.php

pll_register_string( 'walkaboutlove', 'FIRST NAME' );
pll_register_string( 'walkaboutlove', 'COMMENTS / QUESTIONS' );

// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
    $fields['billing']['billing_first_name']['label']  = pll__( 'FIRST NAME' );
    $fields['order']['order_comments']['label']  = pll__( 'COMMENTS / QUESTIONS' );
     // проверяю var_dump($fields['order']['order_comments']['label']); - изменения применены как и положено
     return $fields;
}

I don’t understand what the reason is buried, because the woocommerce documentation itself says everything exactly like mine
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
     $fields['order']['order_comments']['placeholder'] = 'My new placeholder';
     $fields['order']['order_comments']['label'] = 'My new label';
     return $fields;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question