-
Author
-
September 2, 2015 at 17:56 #75853nicheleadParticipant
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 🙂
September 2, 2015 at 23:56 #75923sharmstrModeratorIts 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 3, 2015 at 01:06 #75943nicheleadParticipantThanks!
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’…September 3, 2015 at 03:43 #75965sharmstrModeratorYou 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 3, 2015 at 18:31 #76068nicheleadParticipantI 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?
September 3, 2015 at 18:48 #76081sharmstrModeratorDont 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 3, 2015 at 19:28 #76091nicheleadParticipantI 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?September 3, 2015 at 20:08 #76095nicheleadParticipantIf 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!
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.