Support » Fixing WordPress » Unable to change “place order” text

  • Resolved samuelbeaubien

    (@samuelbeaubien)


    Hey guys, I tried to change the text for the Place Order button on the checkout page and was not able to! This is a recap :
    My wordpress front and back end are in french
    My site is 100% in french except the order review part of the checkout page
    When I edit the page in Elementor, I see it Ok in french : Payer
    When I refresh the live page, I see it in french for a second then it loads in english.
    I tried this code snippet : add_filter( ‘woocommerce_order_button_text’, ‘wpglorify_rename_place_order_button’ );

    function wpglorify_rename_place_order_button() {
    return ‘PAYER ‘;
    }
    I tried to locate the string of text using loco translate
    I searched : All core pluggins, woocomerce and theme for the “place order” string and translated it everywhere it was not already.
    I tried to create a custom checkout page using CartFlows pluggin.
    There is a setting specificaly for the text on that button. It shows Ok in french in Elementor but always loads the english “Place order”

    Does any of this ring a bell to one of you guys? Is is overwritten by my theme maybe? I do not know what to try anymore!
    Thank you in advance

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

Viewing 15 replies - 1 through 15 (of 17 total)
  • Stef

    (@serafinnyc)

    You could try this snippet, but you may also need to add a translator.

    add_filter( 'woocommerce_order_button_text', 'woo_custom_order_button_text' ); 
    
    function woo_custom_order_button_text() {
        return __( 'Whatever You Want To Say Here', 'woocommerce' ); 
    }
    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    I added this snippet and used loco translate. issue still there. Loco translate should work right? I did translate the place order string and saved. I targeted that the square pluggin might be causing this. It shows ok in french when it is deactivated.

    Stef

    (@serafinnyc)

    There may be other circumstances, but that snippet works. Tested & works. And you cleared cache as well?

    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    Yeah the snippet should work but it is not. It is overwritten by something right?

    Stef

    (@serafinnyc)

    Where are you adding the snippet by the way? What file?

    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    I go in appearance, Theme editor, and click on Function PHP, then I add the code at the end.

    Stef

    (@serafinnyc)

    While I don’t advise anyone ever edit that way, if that’s all you have so be it. Please use a child theme in the future and FTP to edit files. The way you’re doing it is not advised.

    Try adding it immediately after the opening <?php

    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    Still does not work. I will research on how to create a child theme.

    Stef

    (@serafinnyc)

    If it doesn’t work then something is controlling your theme. I did see Elementor being used and that plugin has a tendency to override everything.

    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    The snippet works but the change is only visible in Elementor preview, not on the live site. I purged all cache everywhere, tried multiple brownsers.

    Stef

    (@serafinnyc)

    Have you tried in an incognito/private browser?

    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    yes

    Stef

    (@serafinnyc)

    Then my money is on a plugin or Elementor. That’s a premium theme you’re using? So you may want to ask the author as well.

    Thread Starter samuelbeaubien

    (@samuelbeaubien)

    They were not very helpful yet.
    I deactivated all plugins except woocommerce. Now the snippet works pefectly fine.
    Its the woocommerce Square payments pluggin that is causing this. Issue shows up when I activate it.
    Knowing that, I have to find a way translate that pluggin.
    Loco Translate did not seem to work. Maybe I am doing something wrong.
    On the good path. I appreciate all the help btw thank you.

    Stef

    (@serafinnyc)

    Ok so now turn on each plugin one by one until it doesn’t work anymore and then you’ll know which one it is.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Unable to change “place order” text’ is closed to new replies.