Public Ticket #3778347

Change the "SALE!" tag

Closed
Comments
6 Tickets 2
Mustafa started the conversation 2 years ago on December 5, 2024 at 8:23pm

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://b2bkingplugin.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:

2,762
KingsPlugins replied 2 years ago on December 7, 2024 at 6:00pm

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,762
KingsPlugins replied 2 years ago on December 14, 2024 at 1:58am

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?

Sign In