Jump to content

How to change text on product flags?


Ray UK

Recommended Posts

How can I change the wording on the product flag "ON SALE!"

In previous PS it was in the product.tpl, but now I cant find where to do it.

I know its a UL that is populated somewhere but I can not find it.

Thanks in advance

Link to comment
Share on other sites

  • 4 months later...

In my experience you do not need to edit product.tpl, you just need to find that translations in the default theme (classic), If you cant find those terms in the theme translations you will find them in the classic theme translations. It's a common error.

 

 

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...
  • 1 month later...

Hello.

I changed the text of the flag "On sale!" in the "ProductLazyArray.php" file. My problem is now I can't change the translation of this flag. On the Theme translation - Classic - Shop - Theme - Catalog, there is still "On sale!" and the translation is not operative.

Can you help me ?

Thank you.

Edited by Jojo Kaly (see edit history)
Link to comment
Share on other sites

  • 2 years later...

[excuse my english]

I translated "new" and "new products" everywhere, caché bla bla... but for some reason doesn't work. Problems started with version: 1.7.8.7

My desesperate solution :

/src/Adapter/Presenter/Product/ProductLazyArray.php (line 481)

if ($this->product['new']) {
            $flags['new'] = [
                'type' => 'new',
                'label' => $this->translator->trans('New', [], 'Shop.Theme.Catalog'), // put what you want there... i.e: "NOVEDAD, NO NUEVO!!!"
            ];
        }

Edited by Toto Mir
bla. (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 1 year later...
En 24/8/2022 a las 12:28 AM, Toto Mir dijo:

[excuse my english]

I translated "new" and "new products" everywhere, caché bla bla... but for some reason doesn't work. Problems started with version: 1.7.8.7

My desesperate solution :

/src/Adapter/Presenter/Product/ProductLazyArray.php (line 481)

if ($this->product['new']) {
            $flags['new'] = [
                'type' => 'new',
                'label' => $this->translator->trans('New', [], 'Shop.Theme.Catalog'), // put what you want there... i.e: "NOVEDAD, NO NUEVO!!!"
            ];
        }

This is valid for PS8 too.

Link to comment
Share on other sites

If after update your flag automatically changes the language go in ProductLazyArray.php and edit 493 line from  'label' => $this->translator->trans('New', [], 'Shop.Theme.Global'),  -- to    'label' => $this->translator->trans('New', [], 'Shop.Theme.Catalog'), and then you can translate it from the back office in option front office - catalog - new ! 

file location - src\Adapter\Presenter\Product

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...