Good afternoon, we recently purchased a subscription to automatic translation for your site, we translated almost everything except for one thing, this thing is due to the fact that we added an additional feature to our template when the price of the product is zero instead of the price of zero, it says that “the price is available on request”
For this feature, we have added a new function to the child version of the template:
function filter_woocommerce_empty_price_html($price, $_product) {
if ($_product->get_price() == 0) return __('<span class="woocommerce-Price-amount amount"> the price is available on request </span>');
return $price;
}
add_filter( 'woocommerce_empty_price_html', 'filter_woocommerce_empty_price_html', 10, 2 );
Is it possible to somehow add information about the input that if in Russian then the phrase will be different, if in Latvian then the phrase will be different, If in Lithuanian then the phrase will be different and so on…
Thank you for contacting WPML support, I'd be happy to help you with this issue.
You are using a custom code to display the custom text if the price is empty. I would like to inform you that helping you with custom code, is out of the scope of WPML, but I suggest you can try:
1. Add the text domain to the gettext __() function, "avada-child" for example:
function filter_woocommerce_empty_price_html($price, $_product) {
if ($_product->get_price() == 0) return __('<span class="woocommerce-Price-amount amount"> the price is available on request </span>', 'avada-child');
return $price;
}
2. Go to WPML > Theme and plugins localization > Scan strings in the child theme.
3. Go to WPML > String Translation > Translate that string into other languages.
If you are not able to accomplish this, I would recommend you contact one of our certified partners that will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/