Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using WooCommerce, and using a BACS Payment method which is actually Bank Trasnfer. The fields account details are fine, but for Indian context.. i need to change following two fields labels to something else. For example:

Change IBAN label to MICR Code, and BIC to IFSC.

And also need to disable Sort Code.

However, please note that I don't to make chanegs into plugin's code itself. So looking for some function that can help change the label from my theme function file.

Any help is appreciated.

share|improve this question
    
Are you sure the documentation has nothing about this? The answer to your other similar Question was a "Google this for me" solution... –  brasofilo Dec 31 '12 at 13:06
    
Yes, after posting it here.. I find a way to implement it in Woo Commerce codex. But earlier I was unable to find that, hence posted it here. Thanks –  Krunal Jan 1 '13 at 5:27
add comment

1 Answer

up vote 3 down vote accepted

It gets its label using a localisation call, __('IBAN', 'woocommerce'), so you could always just intercept that and change the text:

/**
* filter translations, to replace some WooCommerce text with our own
* @param string $translation the translated text
* @param string $text the text before translation
* @param string $domain the gettext domain for translation
* @return string
*/
function wpse_77783_woo_bacs_ibn($translation, $text, $domain) {
    if ($domain == 'woocommerce') {
        switch ($text) {
            case 'IBAN':
                $translation = 'MICR';
                break;

            case 'BIC':
                $translation = 'IFSC';
                break;
        }
    }

    return $translation;
}

add_filter('gettext', 'wpse_77783_woo_bacs_ibn', 10, 3);
share|improve this answer
    
hey, thanks. I was sure there must be a way for this.. but I was unable to figure out it my self. How did you find it? May be next time I can figure out it myself. –  Krunal Jan 1 '13 at 5:25
    
I went to the best documentation there is: the source code. Documentation often lies or is deficient, but the source code rarely lies. In this instance, I looked in the code for that payment gateway module: woocommerce/classes/gateways/bacs/class-wc-bacs.php –  webaware Jan 1 '13 at 6:01
    
hmm... yes, you're right. Thanks –  Krunal Jan 1 '13 at 6:10
    
Thanks. This also works if you are trying to get it to show Australian bank information which is represented as BSB and Account Number. –  marblegravy Dec 11 '13 at 9:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.