How to change Woocommerce Add to Cart button text – Easy Method

There are many reasons that you would like to change Woocommerce Add to cart button text. You are probably searching for a way to change this to something else like “Add to basket”, “Purchase Now”, “Buy Now”, “Book Now” etc. In this post, I will share a very easy method to change add the cart button text.

Follow these easy simple steps to change Woocommerce add to cart button text

1. Open WordPress dashboard Appearance > Theme file editor

Screenshot 2022 03 30 220523

2. Then search for a file named functions.php in your theme

change woocommerce add to cart button

3. Copy and paste the below-given code into the file just before closing PHP tags and save. Before saving make sure you change the text Purchase now to something which you would like to use for your website.

// This will change add to cart button text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'inf_change_woocommerce_single_add_to_cart_text' ); 
function inf_change_woocommerce_single_add_to_cart_text() {
    return __( 'Purchase Now', 'woocommerce' ); 
}

// This will change add to cart button text on Archive pages and products loop
add_filter( 'woocommerce_product_add_to_cart_text', 'inf_change_woocommerce_add_to_cart_text' );  
function inf_change_woocommerce_add_to_cart_text() {
    return __( 'Purchase Now', 'woocommerce' );
}

Congratulations now your add to cart button is successfully changed. If you need any help or you have any questions use the comment section to submit your questions.

change woocommerce add to cart button text

Leave a Reply

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