Not able to change the the text of "Read more" button on single product page
-
I have installed the woocommerce version 2.4.6 and am trying to change the text of “Read More” button for a external product on a single product page.
From tons of research, I have found this information for changing the text.
[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); function custom_woocommerce_product_add_to_cart_text() { global $product; $product_type = $product-> product_type; switch ( $product_type ) { case 'external': return __( 'Buy product', 'woocommerce' ); break; case 'grouped': return __( 'View products', 'woocommerce' ); break; case 'simple': return __( 'Add to cart', 'woocommerce' ); break; case 'variable': return __( 'Select options', 'woocommerce' ); break; default: return __( 'Buy Now', 'woocommerce' ); } }
First i added this code to functions.php file of the theme.
It didnt workThen i added it to the wc-template-functions.php file of the woocommmerce.
It is still not working.Kindly let me know what i am not doing correctly.
I need to change the text and URL. All quick help is highly appreciated.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Not able to change the the text of "Read more" button on single product page’ is closed to new replies.