Hello,
is it possible to add “Price:” before 35$ for example?
https://prnt.sc/12dzhsh
This topic has 6 replies, 3 voices, and was last updated 4 years, 7 months ago ago by buscape
Hello,
is it possible to add “Price:” before 35$ for example?
https://prnt.sc/12dzhsh
Hello
Thank you so much for contacting us!
You can add Word Price by adding this code in functions.php file
/**
* Add text before the price
*/
add_filter( 'woocommerce_get_price_html', 'xstore_text_before_price' );
function xstore_text_before_price($price){
$text_to_add_before_price = ' Price ' ; //change text in bracket to your preferred text
return $text_to_add_before_price . $price ;
}
Robert Hall
How can I translate it with WPML?
WPML support told me that WPML can’t read it as it is not done according to WordPress standards. And they gave me this: https://developer.wordpress.org/themes/functionality/internationalization/#how-to-internationalize-your-theme
and this
https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/
Hello,
Yes, wrap price string within a __() function and add child theme text domain, for example
$text_to_add_before_price = __( 'Price', 'xstore-child' ); //change text in bracket to your preferred text and translate it using string translator https://prnt.sc/12j6i94
Regards
Great, thank you!
The issue related to '‘Adding word price before the value’' has been successfully resolved, and the topic is now closed for further responses