Today i would like to show you how to change “Add to cart” button text at WooCommerce shop or category page. Sometimes we need to add “Learn More” button at each product so that more people will click this button and redirect to product page, and we just need to use below code to update existing “Add to cart” text or just add a new button for each product.

You need to add below code into your theme functions.php file. (Check this guideline to add code into theme functions.php)

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'custom_woocommerce_template_loop_add_to_cart', 10 );</code>

function custom_woocommerce_template_loop_add_to_cart() {
  global $product;
  echo '<form action="' . esc_url( $product->get_permalink( $product->id ) ) . '" method="post"><button    type="submit ">' . __('Learn More', 'woocommerce') . '</button></form>';
}

The Result:

How to Change WooCommerce Add to Cart text to Learn More

How to Change WooCommerce Add to Cart text to Learn More