Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1126686

    Hello, good evening, how are you? I opened a topic a while ago wanting to translate some woocommerce phrases. I was referred to a program called Poedit to translate. With him I was able to arrange several translations. However, the only one I couldn’t get was on the checkout page, this phrase “Yes, I would like to be added to your mailing list”


    Could someone tell me a javascript code that can translate this sentence? I could not.

    Here is the page link: https://casazero.cz/armazem/checkout/

    But you need to put a product in the cart to appear.

    I will leave in the private part of the post temporary login and password information in case you need it. Thank you guys!

    #1128138

    Hey LuizaCFranco,
    Sorry for the late reply, below is a script to add to the end of your functions.php file in Appearance > Editor to change the text, but in my test after this changes the text another script seems to change it back again. If you have a script or translation doing this please try to disable it so this will work. If you can’t disable and you want us to get more aggressive to force it, then we will, but I wanted to check first.

    function custom_mailpoet_optin_text(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
    $( ".woocommerce-terms-and-conditions-checkbox-text" )
      .text( "Sim, gostaria de ser adicionado à sua lista de discussão." );
     });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_mailpoet_optin_text');

    Please try this so you can see what I mean.

    Best regards,
    Mike

    #1129410

    Thanks for trying to help. However this code is causing the site to appear HTTP 500 error. Can you try another code please? If you need to, the login and password information of the site is in the private part of the post. Thank you

    #1129434

    Hi,
    I would be happy to try, but since you got a 500 error, I would be concerned that I would also get the same error and crash your site. Please include FTP access in the Private Content area so if this occurs I can remove the code and bring your site back online.

    Best regards,
    Mike

    #1129728

    The requested data is in the private part of my answer. Thank you very much

    #1129836

    Hi,
    Thank you for the login and ftp access, I found that the function above was already in the functions.php and the site didn’t throw a 500 error, but it was on line 652 instead of at the end, which seems to be working good. So I don’t know why you were getting a 500 error.
    Anyways, woocommerce was still changing the check box text back to English after my script ran, so to correct I added a “setTimeout” function which makes it wait a number of seconds before running, in this case I set it to 4 seconds (4000) and now it is working good. If you wish you can adjust to fewer seconds, just try 3 or 2 and see if it still works, it’s up to you.
    Here is the new function that I added:

    function custom_mailpoet_optin_text(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
    	  setTimeout(function () {
    $( ".woocommerce-terms-and-conditions-checkbox-text" )
      .text( "Sim, gostaria de ser adicionado à sua lista de discussão." );
    }, 4000);
     });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_mailpoet_optin_text');

    Best regards,
    Mike

    #1130052

    Thank you, my problem has been solved

    #1130115

    Hi,

    Glad we could help!

    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    Please bookmark Enfold Documentation for future reference.
    Thank you for using Enfold :)

    Best regards,
    Basilis

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

The topic ‘Checkout Woocommerce’ is closed to new replies.