WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Change "Sort Code" to "BSB" for Bacs payment method. (14 posts)

  1. GusRuss89
    Member
    Posted 1 year ago #

    Hi all,

    I'm just wondering how I'd go about changing the title for "Sort Code" on the front end. It gets output after your account number if you choose the Bank Transfer payment method. This isn't a title we use in Australia, and I'd like to change it to "BSB".

    Thanks,

    Angus

    http://wordpress.org/extend/plugins/woocommerce/

  2. brightideasdesign
    Member
    Posted 1 year ago #

    Hi,

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

    Thanks

    Nathan

  3. bubg
    Member
    Posted 1 year ago #

    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

  4. bubg
    Member
    Posted 1 year ago #

    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

  5. johnsonyap
    Member
    Posted 1 year ago #

    Hi bubg,

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

    REgards,
    Johnson

  6. groggy72
    Member
    Posted 1 year ago #

    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????

  7. groggy72
    Member
    Posted 1 year ago #

    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;
    }

  8. groggy72
    Member
    Posted 1 year ago #

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

  9. groggy72
    Member
    Posted 1 year ago #

    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

  10. groggy72
    Member
    Posted 1 year ago #

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

    'sort_code' => __( 'Sort Code', 'woocommerce' )

    to

    'sort_code' => __( 'BSB Code', 'woocommerce' )

  11. varktech.com
    Member
    Posted 1 year ago #

    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.

  12. groggy72
    Member
    Posted 1 year ago #

    Thank you. Great tip

  13. itchybrain
    Member
    Posted 1 year ago #

    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

  14. clothncraft
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic