I'm trying to modify the Billing and Shipping text in the Order Details page, in my admin panel. (Screenshot)
I know, I can achieve this by editing the "class-wc-meta-box-order-data.php" file in the following directory & I was successful but know my changes will disappear after the update.
File location:
wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php
The Billing text is located on 312 Line & the Shipping Text is located on 428 Line.
I want to replace Billing with Sender Information
Shipping will be replaced with Recipient Information
I've tried using the following code & It worked, but I want to replace these words on the Order Details page only, in the admin panel, but this code is replacing these words on the frontend as well & I just want to update these words in the admin panel.
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');
function translate_reply($translated) {
$translated = str_ireplace('Shipping', 'Recipient Information',
$translated);
$translated = str_ireplace('Billing', 'Sender Information', $translated);
return $translated;
}
I've also tried placing the file directory in my child theme (after editing it), but it didn't work.