This topic has 7 replies, 2 voices, and was last updated 9 years by nichelead.

  • Author
  • #75853
     nichelead
    Participant

    Hi,

    When viewing an order through My Account Endpoint (e.g. my-account/view-order/1470/), there is a button at the bottom of the order view that redirects back to My Account. This button’s display text is ‘My Account’, and the button’s name is “View All Orders”. I would like to change the display text of this button to ‘Close’ – so I looked in all of Woocommerce templates for Account and for Order, but couldn’t find any code that generates this button (I also asked woocommerce support and they said there is no such button in their code).
    I looked in Kleo files but didn’t find anything as well.

    Can you help please 🙂

    #75923
     sharmstr
    Moderator

    Its in kleo/lib/plugin-woocommerce/config.php on line 1612. You can translate it

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #75943
     nichelead
    Participant

    Thanks!

    How do I change the button text?
    I copied this config file to my child theme (themes/kleo-child/lib/plugin-woocommerce/config.php) and changed ‘My Account’ to ‘Close’, but the button still displays ‘My Account’…

    #75965
     sharmstr
    Moderator

    You cant copy the file. You have to translate the text using standard translating techniques.

    https://archived.seventhqueen.com/documentation/kleo#translation

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #76068
     nichelead
    Participant

    I don’t understand. I don’t need a translation to different language, just to change the text of this button. Is there a snippet I can add to function.php that will do that?

    #76081
     sharmstr
    Moderator

    Dont confuse “translating” to mean it has to be in a different language. It can still be your default language. Its the way to change text now in WP and other plugins like Buddypress.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #76091
     nichelead
    Participant

    I spent lots of time searching and did not fine yet a clear solution for this simple change.
    Do I need to copy the us english po & mo files to my child theme, and there change the button text in the po file?

    #76095
     nichelead
    Participant

    If anyone interested – this is the snippet I used to change the text of the button (‘My Account’) to my custom text (‘Exit This Order’).

    function my_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case ‘My Account’ :
    $translated_text = __( ‘Exit This Order’, ‘kleo_framework’ );
    break;
    }
    return $translated_text;
    }
    add_filter( ‘gettext’, ‘my_text_strings’, 20, 3 );

    Here is where I got it from:
    http://speakinginbytes.com/2013/10/gettext-filter-wordpress/

    All the best!

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?