Viewing 5 replies - 1 through 5 (of 5 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Hello, giuliolizzi

    Try adding this to the bottom of your functions.php file. You can find that by going to appearance>editor>functions.php

    add_filter('woocommerce_sale_flash', 'avia_change_sale_content', 10, 3);
    function avia_change_sale_content($content, $post, $product){
    $content = '<span class="onsale">'.__( 'Sale custom text!', 'woocommerce' ).'</span>';
    return $content;
    }

    Of course, you will want to change: “Sale custom text!” with the actual text you want to use.

    Let me know if this works for you!

    Thread Starter giuliolizzi

    (@giuliolizzi)

    Thank you for the reply. Unfortunately it doesn’t works.

    You can take a look to my e-commerce: https://www.expolavoroesicurezza.it/shop/

    What I want to translate is the word “SALE” (in the dark-gray circle) overlaid on the product pictures.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Actually it did work, however the theme you are using chose to include the text as an image rather than as plain text.

    Here you can see your changes worked:
    https://oi62.tinypic.com/fkp4rd.jpg

    But this is why no changes happened:
    https://www.expolavoroesicurezza.it/shop/wp-content/themes/fruitful/images/action.png

    I suppose you could edit the photo and change the text in photoshop and re-upload it. You may want to create a child theme, but that is up to you.

    Thread Starter giuliolizzi

    (@giuliolizzi)

    Now it works! Thank you very much! My turn next time!

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    No problem. I’m glad you got it figured out!

    I would make a suggestion to the theme developer if I were you for theme to use CSS rather than an Image there. They could easily make it so the circle is done in CSS and is built to wrap around what text is located there. So when page is translated, the text changes.

    Just a suggestion;)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Translate "SALE" flash on products in WooCommerce’ is closed to new replies.