Hello there,
we hope you’re doing well!
Actually, our plugin does not handle the translations of those buttons. Checking their html, it seems that they come from your theme. However, if instead of translating you prefer to simply change that text, you can do so by adding the following code in the functions.php file of your active child theme:
add_action( 'wp_head', 'change_buy_now_text' );
function change_buy_now_text() {
?>
<script type="text/javascript">
jQuery(function ($) {
$( "button.tbay-buy-now.button" ).text( "your Turkish text" );
});
</script>
<?php
}
Could you check it, please? If you want to translate it (and keep the English string), we recommend you contact your theme’s support directly.
Have a nice day!
Thread Starter
ops159
(@ops159)
this didn’t work
..
theme not supported
Thread Starter
ops159
(@ops159)
I don’t understand where is this file in the theme. Theme support says use loco translate. it didn’t work for me
Hello there,
The code should really work, if not, try the following:
if ( ! function_exists( 'yith_wcwl_wishlist_add_styles' ) ) {
function yith_wcwl_wishlist_add_styles() {
$jquery = 'jQuery( function($) {
$( "button.tbay-buy-now.button" ).text( "your Turkish text" );
});';
wp_add_inline_script( 'jquery-yith-wcwl', $jquery );
wp_add_inline_script( 'jquery-yith-wcwl-user', $jquery );
}
add_action( 'wp_enqueue_scripts', 'yith_wcwl_wishlist_add_styles', 99 );
}
If it still doesn’t work for you, you could try adding the code in a plugin to add codes such as Snippets.
Really beyond what we have told you we cannot do, since it is out of our reach, we are sorry. You could ask your theme support about how to change that text directly from your theme, it should be easy.
Let us know any news.
Have a nice day!
Thread Starter
ops159
(@ops159)
@juaancmendez thank you . this piece of code you gave was effective on the desktop. however, add to cart and buy now text are still in English on mobile.
can i give you the information please take a look
damlayan_Caglar@hotmail.com can you leave a message
Hello there,
In order to change these texts, replace the past code with this new one:
if ( ! function_exists( 'yith_wcwl_wishlist_add_styles' ) ) {
function yith_wcwl_wishlist_add_styles() {
$jquery = 'jQuery( function($) {
/*for desktop view*/
$( "button.tbay-buy-now.button" ).text( "your Turkish text" );
/*for mobile view*/
$( ".mobile-btn-cart-click #tbay-click-addtocart" ).text( "your Turkish text" );
$( ".mobile-btn-cart-click #tbay-click-buy-now" ).text( "your Turkish text" );
});';
wp_add_inline_script( 'jquery-yith-wcwl', $jquery );
wp_add_inline_script( 'jquery-yith-wcwl-user', $jquery );
}
add_action( 'wp_enqueue_scripts', 'yith_wcwl_wishlist_add_styles', 99 );
}
Try it out and tell us any news.
Have a nice weekend!
Thread Starter
ops159
(@ops159)
@juaancmendez Thank you very much for your hard work.
I searched all the files I was curious about. nothing worked. but I’m curious because it’s not in the files.
Let’s stay curious.
thank you for your help. problem solved