Background of the issue:
I would like to translate a text added in the function php. I've read that you need to provide the text with gettext function. This is the extra code in the function php:
//international posting cart message
function add_checkout_notice() {
}
add_action( 'woocommerce_review_order_before_submit', 'show_checkout_notice', 10 ); //remove if you do not want to show it on the checkout page
if( !in_array( WC()->customer->shipping_country, $msg_states ) ) {
echo ' Please Note: As we ship from the EU, International orders (outside the EU) may incur additional custom, VAT and tax charges for which we are not responsible for.';
}
}
?>
Symptoms:
I have no programming knowledge and don't know where to put the _() function.
Questions:
Can you help me understand where to put the _() function in my PHP code to translate the text?
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.