Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/1ac9189fcc724acacd8fca29c772be57 to your computer and use it in GitHub Desktop.
Save Shelob9/1ac9189fcc724acacd8fca29c772be57 to your computer and use it in GitHub Desktop.
Change Billing Details text on free checkout
<?php
add_filter( 'gettext', function( $translated_text, $untranslated_text, $domain ) {
if ( function_exists( 'wc' ) && 'woocommerce' === $domain ) {
//make the changes to the text
switch( $untranslated_text ) {
case 'Billing details':
if ( ! WC()->cart->needs_shipping() && 0.0 === floatval( WC()->cart->get_total( 'edit' ) ) ) {
$translated_text = __( 'NOT billing details', 'interintellect' );
}
break;
}
}
return $translated_text;
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment