/* Change Sitewide Buy Product Text in WooCommerce */
function wpflt_change_buy_product_button_text_sitewide( $button_text, $product ) {
if ( 'external' === $product->get_type() ) {
return $product->button_text ? $product->button_text : 'View Product';
}
return $button_text;
}
add_filter( 'woocommerce_product_add_to_cart_text', 'wpflt_change_buy_product_button_text_sitewide', 10, 2 );
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wpflt_change_buy_product_button_text_sitewide', 10, 2 );
This works only for External Products. The above code changes the “Buy Product” button text to any custom text across all WooCommerce Products. Both, single and product list pages. Replace the “View Product” text with any custom text.
Also Read,
Change the “Buy Product” Button Text on the WooCommerce Single Product Page
Change the “Buy Product” Button Text on the WooCommerce Product Archive Page