Skip to content

PHP code snippet – How to change go to shop button text in woocommerce?

add_filter( 'gettext', 'change_woocommerce_return_to_shop_text', 20, 3 );

function change_woocommerce_return_to_shop_text( $translated_text, $text, $domain ) {

        switch ( $translated_text ) {

            case 'Go to the shop' :

                $translated_text = __( 'Browse Shop', 'woocommerce' );
                break;

        }

    return $translated_text;
}
See also  PHP code snippet - How to check if is connected to database?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.