Jump to content

No Subject was found for new_order in the database


Recommended Posts

Hi! Please help me how to translate the subject of the new_order.html email template. In the backoffice I just find "No Subject was found for new_order in the database"

The email which is sent to me contains the subject "New order - #000001" Where is the place to translate it?

PS version 1.5.6

Edited by kutyi (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 6 months later...

answer from the bugtracker...

http://forge.prestashop.com/browse/PSCFV-10827

 

Hi,

It seems that mailalert module has the same email name that the customer order email.

In the mails directory of your language, find a file named lang.php, at the bottom you should find the translation for "New order - #%06d" where you can change it.

For french

$_LANGMAIL['New order - #%06d'] = 'Nouvelle commande - #%06d';

Best regards

 

 

except it is not fixed for installed modules.

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

  • 7 months later...
  • 2 weeks later...

 

For PrestaShop 1.6.0.9 / module version 3.4.4, the line to add is:

In file /themes/yourtheme/mails/lang/yourlang.php

$_LANGMAIL['New order : #%d - %s'] = 'Nouvelle commande : #%d - %s';

I'm in PS 1.5.4.1, having the same trouble. Emailalerts sent to the shop, such as "new_order" have in the email template translations have a "no subject was found for new_order in the database".

 

I've tried editing mails/es/lang.php and adding a line

 

$_LANGMAIL['New order'] = 'Nuevo pedido';

 

but seems is not working. What I'm missing ?

Link to comment
Share on other sites

I'm in PS 1.5.4.1, having the same trouble. Emailalerts sent to the shop, such as "new_order" have in the email template translations have a "no subject was found for new_order in the database".

 

I've tried editing mails/es/lang.php and adding a line

 

$_LANGMAIL['New order'] = 'Nuevo pedido';

 

but seems is not working. What I'm missing ?

I've google around and found an example of mailalerts.php, which has:

 

    // Filling-in vars for email

        $template = 'new_order';

        $subject = $this->l('New order', $id_lang);

        $templateVars = array(

 

however, mind don't have the

$subject = $this->l('New order', $id_lang);

 

should I add it or this is an old version of myalerts.php ?

Link to comment
Share on other sites

I'm in PS 1.5.4.1, having the same trouble. Emailalerts sent to the shop, such as "new_order" have in the email template translations have a "no subject was found for new_order in the database".

 

I've tried editing mails/es/lang.php and adding a line

 

$_LANGMAIL['New order'] = 'Nuevo pedido';

 

but seems is not working. What I'm missing ?

 

The file to edit is in you theme's folder:

/themes/yourtheme/mails/lang/yourlang.php

Link to comment
Share on other sites

The file to edit is in you theme's folder:

/themes/yourtheme/mails/lang/yourlang.php

Tried, but didn't worked.

 

In /modules/mailalerts/mailalerts.php  I've found this text

 

                       {

                                Mail::Send(

                                        $id_lang,

                                        'new_order',

                                        sprintf(Mail::l('New order : #%d - %s', $id_lang), $order->id, $order->reference),

                                        $template_vars,

                                        $merchant_mail,

                                        null,

                                        $configuration['PS_SHOP_EMAIL'],

                                        $configuration['PS_SHOP_NAME'],

                                        null,

                                        null,

                                        $dir_mail,

                                        null,

                                        $id_shop

                                );

 

 

Seems to me that id_lang is ment to look for the language of the "New order :" text ?

 

I'm going to try to directly replace "New order :" to spanish, but I will prefer to understand what file is being looked up for the automatic translation. Any hint ?

Link to comment
Share on other sites

I'm going to try to directly replace "New order :" to spanish, but I will prefer to understand what file is being looked up for the automatic translation. Any hint ?

 

It was the same for me. It now cost me some time to work it out, but now works.

 

As mentioned above just include the line...

$_LANGMAIL['New order : #%d - %s'] = 'yourlocaltranslation: Nr. %d - %s';

into the file

/themes/theme-name/mails/yourlanguage

The "proof" the module reallx expectes "New order : #%d - %s" (with a : and not a = or something else) can also be checked in the source code in modules/mailalerts/mailalerts.php

                Mail::Send(
                    $id_lang,
                    'new_order',
                    sprintf(Mail::l('New order : #%d - %s', $id_lang), $order->id, $order->reference),
                    $template_vars,
                    $merchant_mail,
                    null,
                    $configuration['PS_SHOP_EMAIL'],
                    $configuration['PS_SHOP_NAME'],
                    null,
                    null,
                    $dir_mail,
                    null,
                    $id_shop
                );

Edit: Very odd: Everything worked fine, then I edited some eMails a bit, and now it doesn't work anymore. I also get the impression that the line which I included and which got it working (see above) is again removed from the lang.php. Any ideas?

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

  • 3 months later...

Edit: Very odd: Everything worked fine, then I edited some eMails a bit, and now it doesn't work anymore. I also get the impression that the line which I included and which got it working (see above) is again removed from the lang.php. Any ideas?

 

Same here - everything was just fine untill I've translated mails with "edit html version" button.

Now I've got "new order" and "out of stock"

Link to comment
Share on other sites

×
×
  • Create New...