Home Forums WoodMart support forum Issue with Translating Page Titles and Other Texts

Issue with Translating Page Titles and Other Texts

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #499462

    ferremarketsa
    Participant

    Hello,

    I am writing to inform you about an issue I am facing with translating page titles in WooCommerce. I used the following code to translate the “Shop” page title to “Tienda”:

    add_filter(‘the_title’, ‘custom_woocommerce_page_title’, 9999);

    function custom_woocommerce_page_title($title) {
    global $post;

    // Check if we are on a WooCommerce page.
    if (is_woocommerce()) {
    // Change the title if it’s “Shop” or “Compare”.
    if ($title === ‘Shop’) {
    return ‘Tienda’;
    }
    if ($title === ‘Compare’) {
    return ‘Comparar’;
    }
    }

    // If none of the above conditions are met, return the original title.
    return $title;
    }

    However, this code does not work for “Wishlist” and “Compare” page titles. Additionally, I tried using Loco Translate, but it did not help in translating these titles as well. Could you please help me resolve this issue? In addition, I would also like to translate other marked texts on my website.

    I look forward to your assistance and thank you in advance for your help.

    Attachments:
    You must be logged in to view attached files.
    #499585

    Hung Pham
    Keymaster

    Hi ferremarketsa,

    Thanks for reaching to us.

    These are Page Title only. You simply change these title https://prnt.sc/9Er6fJ_yIpZb https://prnt.sc/I3LjN3ZFwCm7

    For text inside these pages, navigate to Theme Settings > Shop, here select Compare and Wishlist sections to change description https://prnt.sc/Jcmvip0w0mJm https://prnt.sc/IwwnVKcBJwtU

    Regards,

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