add_filter( 'woocommerce_product_add_to_cart_text', 'mt_archive_custom_cart_button_text' );
function mt_archive_custom_cart_button_text() {
global $product;
if ( has_term( 'category1', 'product_cat', $product->get_id() ) ) {
return 'Category 1 Add Cart';
} else {
return 'Category 2 Buy Now';
}
}