Last active
June 2, 2019 21:34
-
-
Save shirokoweb/7d401445f929b7965ab82b4c63dd1616 to your computer and use it in GitHub Desktop.
Remplacer des chaînes de texte WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Remplacer "Lire la suite" par autre chose | |
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
function custom_woocommerce_product_add_to_cart_text( $text ) { | |
// En utilisant une condition (if) | |
if ( 'Lire la suite' == $text ) { | |
$text = __( 'Commander', 'woocommerce' ); | |
} | |
return $text; | |
} | |
// Personnaliser "Choisir une option" du menu déroulant WC par "Autre chose" | |
add_filter('woocommerce_dropdown_variation_attribute_options_args', 'custom_woocommerce_dropdown_variation_attribute_options_args', 10); | |
function custom_woocommerce_dropdown_variation_attribute_options_args( $args ) { | |
// sans condition (if) | |
$args['show_option_none'] = "Autre chose"; // Remplacer Autre chose | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment