Okay
  Public Ticket #3778347
Change the "SALE!" tag
Closed

Comments

  •  2
    Mustafa started the conversation

    Hello, I solved a problem using the code in the link below in your support documents. First of all, thank you for thinking of this explanation and writing it.

    https://woocommerce-b2b-plugin.com/docs/code-snippets-library-list/#16-toc-title

    But I could not translate the discount label on the products where the best discounts are shown thanks to this code.
    I want to write "FIRSAT" instead of "SALE!" that appears here.


    By the way, there is no problem with the labels I wrote for other discounts in the dynamic discount rules section.

    Attached files:  Screenshot_3.jpg

  •  2,281
    WebWizards replied

    Hello Mustafa,

    Glad to assist,

     

    I understand that you'd like to translate the website, and everything should be in Turkish? (or you have multiple languages?)

     

    I think you can do it by adding this PHP snippet to your site:

    add_filter('gettext', function($translated_text, $text, $domain) {
        if ($text === 'SALE!' || $text === 'Sale!') {
            return 'FIRSAT';
        }
        return $translated_text;
    }, 20, 3);

     

    Let me know if this works for you please.

    Kind regards,

    Stefan

  •  2
    Mustafa replied

    This didn't work. There was no change.

  •  2,281
    WebWizards replied

    Sorry to hear that, I am not sure why that would be.

    It would be great if we could check it directly. Would it be possible to share a backend access to the site, or a staging clone site for that?