Order comments label error
-
Hello! The label for the order comments on checkout, are not able to be translated to Danish. Here is the code which i have implemented into functions.php:
(heavily inspired from the woocommerce docs: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/)add_filter(‘woocommerce_checkout_fields’, ‘custom_order_notes’);
function custom_order_notes( $fields ) {
print_r($fields[‘order’][‘order_comments’]);
$fields[‘order’][‘order_comments’][‘label’] = ‘Bem?rkninger’;
print_r($fields[‘order’][‘order_comments’]);
return $fields;
}The first variable dump shows me that the label has been translated correctly, however it is not shown on the checkout page. Instead the label is: “Order notes”, which i guess is the English default label.
I then edit the label into “Bem?rkninger” and that is shown correctly in the next variable dump.
I also noticed that the placeholder for the textarea, has been translated correctly and it is also shown. So i need help with outputting the correct and translated label for the order_comments instead of the default “Order notes”.PS: i tried editing the text for the placeholder and completely delete the order_comments (using unset) and neither worked for me.
The page I need help with: [log in to see the link]
- The topic ‘Order comments label error’ is closed to new replies.