xxxxxxxxxx
<?php
// replace text select option in woocommerce
add_filter( 'woocommerce_product_add_to_cart_text', 'cst_change_select_options_button_text', 9999, 20 );
function cst_change_select_options_button_text( $label, $product ) {
if ( $product->is_type( 'variable' ) ) {
return 'Personnalisé'; // if is product type variable i return this text
}else{
return 'Voir le Produit'; // if is other product and is not variable i return this text
}
return $label;
}
?>