I have a problem with translating the Add to cart button on woocommerce.
My website is: http://test.mk/OPA The website is in albanian and english. First language is English.
I have installed Polylang Pro plugin and also tried with Loco translate.
I have changed the "name" of the Add to cart button with this code in functions.php:
//To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Order Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Order Now', 'woocommerce' );
}
So, what I really need to translate is Order Now.
I added the string using this code:
add_action('init', function() {
pll_register_string('woocommerce_product_add_to_cart_text', 'Order Now', 'WooCommerce');
});
It is in strings in the polylang plugin, but it is not translating.
Does someone know how to help me to translate the button & the Cart wiget that is also in the website?
Thank you in advance.