WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » Change "Sort Code" to "BSB" for Bacs payment method.

Change "Sort Code" to "BSB" for Bacs payment method.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi,

    I would love to know how to do this as well.

    Thanks

    Nathan

    Hi there… I’m keen to know as well! I’ve narrowed it down to the ‘class-wc-bacs.php’ file but I’m not game to make any changes for fear of breaking it! I’d appreciate any advice.
    Many thanks,
    Denise

    Seems I’ve solved the problem and changed ‘sort code’ to ‘bsb’. I’m a woocommerce and wordpress novice but it’s working fine on my site. I edited the ‘class-wc-bacs.php’ file and am happy to email the changes to you if you still need it.

    Cheers,
    Denise

    Hi bubg,

    Could you please email to changes of the sort code to BSB.
    Thank you.

    REgards,
    Johnson

    I would really appreciate some help with this too please. I edited ‘class-wc-bacs.php also but it stuffed up checkout so I had to revert to a backup. Anyone????

    For anyone who is stuck with this just add the following code into your functions.php file

    add_filter( ‘gettext’, ‘my_gettext’, 10, 3 );

    function my_gettext( $translation, $text, $domain ) {

    if ( ‘woocommerce’ === $domain ) {

    $translations = &get_translations_for_domain( $domain );

    if ( ‘Sort Code’ === $text )
    $translation = $translations->translate( ‘BSB Code’ );
    }

    return $translation;
    }

    I’m sorry, this actually is not working now. Back to square 1…….

    Can anyone help me with this. I contacted woocommerce directly and their answer was less than useless. This is melting my brain. There’s a virtual chocolate muffin in it for the best answer

    Cheers

    Dan

    online line 205 of ‘class-wc-bacs.php change

    ‘sort_code’ => __( ‘Sort Code’, ‘woocommerce’ )

    to

    ‘sort_code’ => __( ‘BSB Code’, ‘woocommerce’ )

    Hi Groggy,
    Rather than change the core file, you could use the POT file to change the wording. That way, your change would be unaffected by future updates.

    Thank you. Great tip

    Gday varktech.com
    could you tell me which is the POT file? A google on this didn’t really explain it in the context that you are offering, but I like that it sounds like there is something good to what you are suggesting.
    cheers
    Darryl

    I’ve discovered this code seems to work …

    function wpse_77783_woo_bacs_ibn($translation, $text, $domain) {
        if ($domain == 'woocommerce') {
            switch ($text) {
                case 'Sort Code':
                    $translation = 'BSB';
                    break;
    
            }
        }
    
        return $translation;
    }
    
    add_filter('gettext', 'wpse_77783_woo_bacs_ibn', 10, 3);

    Placed in the themes functions file

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Change "Sort Code" to "BSB" for Bacs payment method.’ is closed to new replies.
Skip to toolbar