Hy!
Basically I would like to change the ‘Add to cart’ text to ‘Learn more’ in the portfolios.
Thanks in advance.
Hi IkarusDev!
Please install this plugin – https://wordpress.org/plugins/codestyling-localization/
and rescan theme files and edit the strings as needed
Regards,
Yigit
Add to cart is not registered as a string but show details is.
Add this to function.php to change add to cart text:
add_filter( ‘add_to_cart_text’, ‘woo_archive_custom_cart_button_text’ ); // < 2.1
add_filter( ‘woocommerce_product_add_to_cart_text’, ‘woo_archive_custom_cart_button_text’ ); // 2.1 +
function woo_archive_custom_cart_button_text() {
return __( ‘My Add To Cart New Text’, ‘woocommerce’ );
}
Source: http://docs.woothemes.com/document/change-add-to-cart-button-text/
Hi!
Please do not forget to check ‘non-case sensitive’ – http://i.imgur.com/H3wFygj.png
Best regards,
Yigit
Have you found the string with codestyling…? Have search and could not find it. Must use filter.
pasted the code above into functions.php and nothing was happening…
I use WMPL translation plugin…won’t they conflict with eachother?
installed plugin
can’t find english to rescan…
http://gyazo.com/449134a20c6a07148224a727b878d4fd
one step further again but can’t find add to cart… even with non-case-sensitive checked
Hey!
Please try to find the string in Tools > Localization > Plugins > WooCommerce. If that still does not work, please try the function as following
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text' );
function woo_archive_custom_cart_button_text() {
return __( 'My Add To Cart New Text', 'woocommerce' );
}
Regards,
Yigit