Update: add_to_cart_text
hook is obsolete & deprecated. It is replaced in Woocommerce 3+ by woocommerce_product_add_to_cart_text
filter hook.
It can be 2 different things (as your question is not so clear)…
1) To target products on a specific product category archive pages you should use the conditional function is_product_category()
this way:
add_filter( 'woocommerce_product_add_to_cart_text', 'product_cat_add_to_cart_button_text', 20, 1 );
function product_cat_add_to_cart_button_text( $text ) {
// Only for a specific product category archive pages
if( is_product_category( array('preorder') ) )
$text = __( 'Preorder', 'woocommerce' );
return $text;
}
Code goes in function.php file of the active child theme (or active theme).
2) To target a specific product category on Woocommerce archives pages you will use has term()
this way:
add_filter( 'woocommerce_product_add_to_cart_text', 'product_cat_add_to_cart_button_text', 20, 1 );
function product_cat_add_to_cart_button_text( $text ) {
// Only for a specific product category
if( has_term( array('preorder'), 'product_cat' ) )
$text = __( 'Preorder', 'woocommerce' );
return $text;
}
For single product pages you will use additionally this:
add_filter( 'woocommerce_product_single_add_to_cart_text', 'product_cat_single_add_to_cart_button_text', 20, 1 );
function product_cat_single_add_to_cart_button_text( $text ) {
// Only for a specific product category
if( has_term( array('preorder'), 'product_cat' ) )
$text = __( 'Preorder', 'woocommerce' );
return $text;
}
Code goes in function.php file of the active child theme (or active theme).
Tested and works.
Note: All filter hooked functions needs to return the main argument if you set some conditions, so in this case the argument $text
…
Related answer: Targeting product terms from a custom taxonomy in WooCommerce
Related docs: Woocommerce Conditional Tags