2

On the order-recieved page ('woocommerce_thankyou') there is a table with the order details a heading "Order Details" (Ordredetaljer in my native language).

I cannot figure out how to change this heading. I can't even find the source code for it properly. If someone could tell me the string(We use wpml for string translation) or the source code I would be a happy developer.

Picture of the heading in question can be found here

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399

1 Answers1

2

The template you are looking for is located in order/order-details.php

But as WooCommerce templates doesn't seem to work in your theme you can try this alternative:

add_filter('gettext', 'changes_in_thank_you', 100, 3 );
function changes_in_thank_you( $translated_text, $text, $domain ) {
    if( $text === 'Order details' ) {

        $translated_text =  __( 'Your replacement text', $domain );
    }
    return $translated_text;
}

Code goes in function.php file of the active child theme (or active theme).

It should work.

To target specifically "Order received" page you can replace:

if( $text === 'Order details' ) {

by:

if( $text === 'Order details' && is_wc_endpoint_url( 'order-received' ) ) {

In WPML:

1) In "Theme and plugins localization" You can load the translatable text for "Woocommerce" plugin scanning this plugin.
2) In "String translations" you should be able to find the string 'Order details' for the woocommerce domain and change the yranslation for your language…

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • Using this for debugging, i tried to `return "aaaaaaaaaaa"` on all gettext calls. The only thing unaffected was this heading. If nothing overrides this template, and the gettext somehow doesn't supply this translation(it is translated mind you) where i begin debugging this? – Christian Påbøl Jacobsen Jan 15 '18 at 18:07
  • @ChristianPåbølJacobsen I have maid an update at the end… try this. – LoicTheAztec Jan 15 '18 at 18:50