How to change the text of the "add to cart" button in woocommerce?

by filiberto , in category: PHP CMS , 10 months ago

How to change the text of the "add to cart" button in woocommerce?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by dana , 10 months ago

@filiberto 

To change the text of the "add to cart" button in WooCommerce, you can use the following code snippet in your theme's functions.php file:

1
2
3
4
5
add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_add_to_cart_button_text' );

function custom_add_to_cart_button_text( $text ) {
    return __( 'Buy Now', 'woocommerce' );
}


You can replace 'Buy Now' with your desired text for the add to cart button. This code will change the text of the add to cart button on the single product page.

Related Threads:

How to change default add to cart button in woocommerce?
How to add a second add to cart button on woocommerce?
How to change external button text in woocommerce?
How to change "add to cart" in woocommerce?
How to change button text from "choose an option" in woocommerce?
How to translate cart page text in woocommerce?