Woocommerce : How to change the text “Add To Cart”

Kindly follow the below steps to customize the text ADD TO CART in the shop page.

Product details page

Open the file in this path /wp-content/themes/theme-folder/function.php using some editor like DreamWeaver.

If you have activated the child theme then Open the file in this path /wp-content/themes/childtheme-folder/function.php using some editor like DreamWeaver and append the below code.

add_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' );
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text' );
function woo_custom_single_add_to_cart_text() {
return __( 'Product Details', 'woocommerce' );
}

You can change the Product Details text as per your need.

Archive page ( Shop Page )

If you want to change the text under the shop page also means, paste the below code,

add_filter( 'add_to_cart_text', 'woo_custom_product_add_to_cart_text' );
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_product_add_to_cart_text' );
function woo_custom_product_add_to_cart_text() {
return __( 'Product Details', 'woocommerce' );
}

You can change the Product Details text as per your need.

Rate This Article

(62 out of 125 people found this article helpful)

Leave A Comment?

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