2,017 1 minute read
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');
function translate_reply($translated) {
$translated = str_ireplace('Quantity', 'New Label', $translated);
return $translated;
}
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
function shipchange( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Ship to a different address?' :
$translated_text = __( 'Partial Pay', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter('gettext', 'shipchange', 20, 3);
1 2 3 4 | add_filter( 'wpcfe_footer_credits' , 'custom_footer_text' ); function custom_footer_text(){ echo 'Your content here.' ; } |
Send download link to: