Forked from helgatheviking/billing-details-translation.php
          
        
    
          Last active
          April 12, 2022 18:06 
        
      - 
      
- 
        Save Shelob9/1ac9189fcc724acacd8fca29c772be57 to your computer and use it in GitHub Desktop. 
    Change Billing Details text on free checkout
  
        
  
    
      This file contains hidden or 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 | |
| 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