Tagged: button
-
AuthorPosts
-
August 18, 2017 at 6:10 pm #840980
I notice the button on the product pages say “Add To Cart”
And I’m curious if I can get support with quick css code please for it to just say “CHECKOUT”
thank you
August 18, 2017 at 11:53 pm #841088Hey Nathan,
Please add following code to Functions.php file of your child theme
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); function woo_custom_cart_button_text() { return __( 'My Button Text', 'woocommerce' ); }
Best regards,
Jordan ShannonAugust 19, 2017 at 12:25 am #841094thank you for the support for potential code
I added it and the button still says
“Add To Cart”I changed ( ‘CHECKOUT’, ‘woocommerce’ );
}is that the correct spot to edit?
August 19, 2017 at 3:40 pm #841288Hi,
Yes that is the correct spot, it didn’t work? Please provide admin and ftp info so we can look into this further. And, just to confirm you are using WooCommerce correct?
Best regards,
Jordan ShannonAugust 19, 2017 at 5:17 pm #841317yes using woo
August 20, 2017 at 9:48 pm #841767Hi,
It seems that filter was replaced by a plugin starting with v3.0
Please see https://wordpress.org/plugins/wc-custom-add-to-cart-labels/
it is now in your plugin list, please try activating it and choosing your new button text.
I removed the filter code for you so there won’t be any conflict.Best regards,
MikeAugust 21, 2017 at 12:56 am #841799Thank you for the support and clear direction mike
I followed all these steps
and still not change yet
August 21, 2017 at 12:57 am #841800still say “Add To Cart”
August 21, 2017 at 5:20 pm #842108Hi,
I add the following to functions.php and it seems to work:
function add_custom_script(){ ?> <script> jQuery( document ).ready(function() { jQuery(".button.single_add_to_cart_button.button.alt").text("CHECKOUT"); }); </script> <?php } add_action('wp_footer', 'add_custom_script');
Best regards,
Jordan ShannonAugust 21, 2017 at 5:45 pm #842122I feel thankful you create time to help me
How do I access the ” functions.php” area, can you please show me a screenshot so I I need to change the words in the future?
Thank you Jordan
August 21, 2017 at 5:49 pm #842127Hi,
You would follow: Appearance -> Editor -> functions.php. Then just look for the code I pasted above.
Best regards,
Jordan ShannonAugust 21, 2017 at 5:51 pm #842128I feel happy I learned something new today thanks man
August 21, 2017 at 5:56 pm #842133Hi,
No problem at all. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Changing Button Text’ is closed to new replies.