Jump to content

Recommended Posts

Hello,

 

I'm a newbie, and I use Prestashop 1.5.3.

 

I have a problem with the module "Send to a friend". It's about changing its mail's subject.

 

1. Even if I've changed its subject from my Prestashop manager, it doesn't work. And the mails received from the "Send to a friend" form, has this subject "Un ami sent you a link to...".

 

2. I've also changed it in "mails > fr > lang.php" but it didn't solve anything, because the mails received from the "Send to a friend" form, has this subject "Un ami sent you a link to...".

 

3. Besides, the subject is both in english and french, "Un ami sent you a link to...".

 

4. I've also tried to get rid of this issue, by going into "ps_order_state_lang" in my data base. But it was useless. I didn't find any mail's subject matching with "Send to a friend" or with "%1$s sent you a link to %2$s".

 

Since this morning (french time), I'm trying hard to solve this problem, by reading all the Prestashop topics talking about translations or modules issues. And it's getting on my nerves, because I'm not finding the solution :(.

 

Can someone help me efficiently?

 

Thank you :).

 

Deb'

Edited by deb-dou (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hello,

 

It's me again. I'm still searching the web to get rid of this issue. But it's quite difficult because I'm a newbie.

 

Is there anyone to help me?

 

Thank you.

 

Deb'

Share this post


Link to post
Share on other sites

Hello,

 

I've found a solution :

 

1. Go into your FTP.
 
2. Go to "modules > sendtoafriend".
 
3. Edit the file "sendtoafriend_ajax.php"
 
4. Find with the following code (in bold print I've underlined the important parts):

/* Email generation */
        $product = new Product((int)$id_product, false, $module->context->language->id);
        $productLink = $module->context->link->getProductLink($product);
        $customer = $module->context->cookie->customer_firstname ? $module->context->cookie->customer_firstname.' '.$module->context->cookie->customer_lastname : $module->l('A friend', 'sendtoafriend_ajax');

        $templateVars = array(
            '{product}' => $product->name,
            '{product_link}' => $productLink,
            '{customer}' => $customer,
            '{name}' => Tools::safeOutput($friendName)
        );

        /* Email sending */
        if (!Mail::Send((int)$module->context->cookie->id_lang,
                'send_to_a_friend',
                sprintf(Mail::l('%1$s sent you a link to %2$s', (int)$module->context->cookie->id_lang), $customer, $product->name),
                $templateVars, $friendMail,
                null,
                ($module->context->cookie->email ? $module->context->cookie->email : null),
                ($module->context->cookie->customer_firstname ? $module->context->cookie->customer_firstname.' '.$module->context->cookie->customer_lastname : null),
                null,
                null,
                dirname(__FILE__).'/mails/'))
            die('0');

 

5. For a mail's subject with this title "(First name), votre ami(e) vous envoie un lien", you must :

a. replace A friend by votre ami(e) ou Votre ami(e).

 

b. replace %1$s sent you a link to %2$s by %1$s, %2$s vous envoie un lien.

 

c. replace $customer, $product->name  by Tools::safeOutput($friendName), $customer

 

d. save the changes.

 

 

6. Test the module "Send to a friend" by sending yourself an email.

 

Comments :

I've noticed, after these small changes :

 

- the disappearance of "$_LANGMAIL['%1$s sent you a link to %2$'] = '%1$s vous envoie un lien vers %2$s' (see in the FTP "mails > fr > lang.php").

 

- the disappearance of the note "%1$s sent you a link to %2$s" (see in Prestashop back office "Localisations > Traductions > default > 5.jpg  > E-mails pour le module sendtoafriend").

 

That's all for today. And I hope it will help :)

 

Deb'

  • Like 3

Share this post


Link to post
Share on other sites
  • 5 months later...
  • 1 year later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More