• Resolved truex

    (@truex)


    I have been recently trying to translate all content of the site. I assumed it has been successfully completed since the loco translate plugin tells me that all English words have been translated to Polish (it shows that the translation process has been completed 100%).

    When I place an order, I get a ‘thank you’ message that still remains in English, even though it is translated in all language files. I have tried modifying the thankyou.php file, changed the ‘thank you for you order’ phrase into Polish but it still appears in English on checkout page.

    Code below:

    <?php if ( $order->has_status( 'failed' ) ) : ?>
    
            <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
    
            <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
                <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a>
                <?php if ( is_user_logged_in() ) : ?>
                    <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My account', 'woocommerce' ); ?></a>
                <?php endif; ?>
            </p>
    
        <?php else : ?>
    
            <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Dziekujemy za zakupy w naszym sklepie!', 'woocommerce' ), $order ); ?></p>
    
            <ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
    
                <li class="woocommerce-order-overview__order order">
                    <?php _e( 'Numer Zamówienia:', 'woocommerce' ); ?>
                    <strong><?php echo $order->get_order_number(); ?></strong>
                </li>
    
                <li class="woocommerce-order-overview__date date">
                    <?php _e( 'Data:', 'woocommerce' ); ?>
                    <strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong>
                </li>
    
                <?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
                    <li class="woocommerce-order-overview__email email">
                        <?php _e( 'Email:', 'woocommerce' ); ?>
                        <strong><?php echo $order->get_billing_email(); ?></strong>
                    </li>
                <?php endif; ?>
    
                <li class="woocommerce-order-overview__total total">
                    <?php _e( 'Suma:', 'woocommerce' ); ?>
                    <strong><?php echo $order->get_formatted_order_total(); ?></strong>
                </li>
    
                <?php if ( $order->get_payment_method_title() ) : ?>
                    <li class="woocommerce-order-overview__payment-method method">
                        <?php _e( 'Metoda Platnosci:', 'woocommerce' ); ?>
                        <strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
                    </li>
                <?php endif; ?>
    
            </ul>
    
        <?php endif; ?>
    
        <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
        <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
    
    <?php else : ?>
    
        <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Dziekujemy za zakupy w naszym sklepie!', 'woocommerce' ), null ); ?></p>
    
    <?php endif; ?>

    Thank you for all your help

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • ValeDeOro

    (@valedeoro)

    Automattic Happiness Engineer

    Can you check if the translations for the WooCommerce plugin have also been 100% translated? This is where the Thank You message would be generated.

    Do you use any additional plugin to create a custom thank you page? In that case, you might want to check the language files for that plugin as well.

    And if you want to create your own independent custom thank you page, have a look at this tutorial.

    Thread Starter truex

    (@truex)

    Hi the translation has been done 100% here.

    The strange thing I noticed is that when I replace thankyou.php file with the old version of woocommerce thankyou.php file, the ‘thank you.your order has been received’ gets translated into Polish.

    I had to manually translate the message within thankyou.php file and it now works fine.

    Thank you for your help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change Text on Order Received page in WooCommerce’ is closed to new replies.