 oliverS-63
|
Hello WPML Support,
I have the following code snippet hardcoded in my functions.php file:
add_filter( 'woocommerce_cart_item_price', 'kd_custom_price_message' );
function kd_custom_price_message( $price ) {
$afterPriceSymbol = ' zzgl. MwSt. und Versandkosten';
return $price . $afterPriceSymbol;
}
I want to add a get text function to it, but there is a syntax error appearing.
Maybe you can help me out with this one.
Best regards!
|
 Mihai Apetrei
WPML Supporter since 03/2018
Languages:
English (English )
Timezone:
Europe/Bucharest (GMT+03:00)
|
Hi there.
Please take a look here:
https://developer.wordpress.org/themes/functionality/internationalization/#add-text-domain-to-strings
Practically, you need to add everything inside "__()" and also add a "text-domain", so something like this:
__( 'zzgl. MwSt. und Versandkosten', 'any-text-domain-you-want' )
Also, you will need to re-scan the theme or the plugin that you are adding the code to once again:
https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#scanning-the-theme-and-plugins
I hope that you will find this information helpful. 🙂
Mihai Apetrei
|