[resolved] function.php (4 posts)

  1. Jidy
    Posted 1 year ago #


    I asked to woocommerce how to change a cart button text.
    They asked me add this code in your function.php file
    Your functions.php file is located inside your theme. my-theme -> functions.php

    the code is :

    add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' ); // < 2.1
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +

    function woo_custom_cart_button_text() {

    return __( 'My Button Text', 'woocommerce' );

    Could you say me if I need to copy paste the code here :
    Appearance->Theme option->Advanced settings->Custom Css

    Thank you so much

  2. Jidy
    Posted 1 year ago #

    or do I need open the real file .php under dreamweaver for exemple and physically write the code inside the file ?

  3. Kadence Themes
    Theme Author

    Posted 1 year ago #

    You have to put into the functions file of the theme, or a child theme. NOT the custom css. As the script is php.

    But I would avoid this all together and use this plugin: https://wordpress.org/plugins/woocommerce-customizer/

    Kadence Themes

  4. Jidy
    Posted 1 year ago #

    Thank you so much. You saved me again :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic