Jump to content

[RESOLU] Envoyer à un ami - Send to a friend


Recommended Posts

Bonjour,

 

J'ai le module "envoyer à un ami" installé.

 

Il marche parfaitement dans la version anglaise de mon site, mais ne fonctionne pas dans la version française.

 

La traduction du lien est bien faite, mais quand je clique sur mon lien "envoyer à un ami" rien ne se passe.

 

En anglais "send to a friend", il ouvre bien le formulaire.

 

 

Il doit manquer un fichier quelque part ou une ligne de commande, mais quoi et où ?

 

Je suis en 1.5.4.1

 

Merci à vous pour votre aide.

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

Topic déplacé section configuration

Bonjour cher Muche,

C'est sympa de déplacer mon post, mais en tant que Prestator Addict peut-être pourriez-vous m'orienter pour mon problème ?

 

Sur le lien français (qui ne fait rien) j'ai ça :

 

http://www.monsite.com/fr/home/6-belkin-leather-folio-for-ipod-nano-black-chocolate.html#send_friend_form

 

Sur le lien anglais (qui fonctionne) j'ai ça :

 

http://www.monsite.com/en/home/6-belkin-leather-folio-for-ipod-nano-black-chocolate.html#send_friend_form

 

 

 

Je suis en 1.5.4.1

 

Dans le config/xml/1.5.0.17.xml

 

J'ai :

 

<dir name="sendtoafriend" >
		<md5file name="index.php">c606d78252c667440b7e92bc43d4b891</md5file>
		<md5file name="logo.gif">46c2499fb703a7188d6438efd5cdc4cd</md5file>
		<md5file name="logo.png">b4afb644fb9b741439448b79923113db</md5file>
		<dir name="mails" >
			<dir name="de" >
				<md5file name="index.php">c606d78252c667440b7e92bc43d4b891</md5file>
				<md5file name="send_to_a_friend.html">83984349fb2e41968194acb2c915d6ab</md5file>
				<md5file name="send_to_a_friend.txt">4016c4c4a5d96149f7dd5090a4b9bf01</md5file>
			</dir>
			<dir name="en" >
				<md5file name="index.php">c606d78252c667440b7e92bc43d4b891</md5file>
				<md5file name="send_to_a_friend.html">b0e34b8d47bc243cbfec3579997b11f1</md5file>
				<md5file name="send_to_a_friend.txt">7fd0e9a25e7c6873f148d2540f165f43</md5file>
			</dir>
			<dir name="es" >
				<md5file name="index.php">c606d78252c667440b7e92bc43d4b891</md5file>
				<md5file name="send_to_a_friend.html">d55e0536258c949b98df2426d49f6fa9</md5file>
				<md5file name="send_to_a_friend.txt">bddf6e87455144837e8264b6dc2d54c2</md5file>
			</dir>
			<dir name="fr" >
				<md5file name="index.php">c606d78252c667440b7e92bc43d4b891</md5file>
				<md5file name="send_to_a_friend.html">c0f8750bd7fb60b295d7806ad307c5a7</md5file>
				<md5file name="send_to_a_friend.txt">aae79ad0073bdf94c137f8e38db9d89e</md5file>
			</dir>
			<md5file name="index.php">45c1e4f7c1a980d9780fc31d73a950a0</md5file>
			<dir name="it" >
				<md5file name="index.php">c606d78252c667440b7e92bc43d4b891</md5file>
				<md5file name="send_to_a_friend.html">c6fad54e1daafb0ff7a1913cb4b75f12</md5file>
				<md5file name="send_to_a_friend.txt">a29fc3c3479f197704062adea4bb983e</md5file>
			</dir>
		</dir>
		<md5file name="product_page.tpl">50db8115294076adde0e89adeade7ec5</md5file>
		<md5file name="sendtoafriend-extra.tpl">e1fbc174a39cad1a5e98139aa373fe94</md5file>
		<md5file name="sendtoafriend-form.php">4845294c5b528768a4d1c6dcdb1a15d3</md5file>
		<md5file name="sendtoafriend.css">55579878c6bdcc0d6b6d8158b378de2f</md5file>
		<md5file name="sendtoafriend.php">8ed066e33d06b68b1d222552a3e80eca</md5file>
		<md5file name="sendtoafriend.png">baaa6accd945fcb4480b29ab2e15bded</md5file>
		<md5file name="sendtoafriend.tpl">f69ea5e158e0d9659e1db6f65d094274</md5file>
		<md5file name="sendtoafriend_ajax.php">1fdd16e0fbb0f36e011d20fc39822d66</md5file>
		<dir name="translations" >
		</dir>
	</dir>

 

 

Dans le config/xml/1.5.4.1.html

J'ai :

 

	   	 <dir name="sendtoafriend" >
		<md5file name="index.php">aebee38471268bb7b437690f47aa3d80</md5file>
		<md5file name="logo.gif">46c2499fb703a7188d6438efd5cdc4cd</md5file>
		<md5file name="logo.png">b4afb644fb9b741439448b79923113db</md5file>
		<dir name="mails" >
			<dir name="en" >
				<md5file name="index.php">aebee38471268bb7b437690f47aa3d80</md5file>
				<md5file name="send_to_a_friend.html">d3e7dfd9bc2b8e46b636c9ebb8f2ad9e</md5file>
				<md5file name="send_to_a_friend.txt">7fd0e9a25e7c6873f148d2540f165f43</md5file>
			</dir>
	   	 <md5file name="index.php">fbc7e57e8be5c0d40903b4a1b3c945a2</md5file>
		</dir>
		<md5file name="product_page.tpl">31e4608b5eb37d8c15e9be8cfd057846</md5file>
		<md5file name="sendtoafriend-extra.tpl">f30084a48355f105503260a31be56b24</md5file>
		<md5file name="sendtoafriend.css">55579878c6bdcc0d6b6d8158b378de2f</md5file>
		<md5file name="sendtoafriend.php">863037ccfb1de33911abb2171be9fba9</md5file>
		<md5file name="sendtoafriend.png">baaa6accd945fcb4480b29ab2e15bded</md5file>
		<md5file name="sendtoafriend.tpl">f36b5c812c9f241a361680d062587158</md5file>
		<md5file name="sendtoafriend_ajax.php">656[spam-filter]bf9808a7e8b168ee9e379157</md5file>
		<dir name="translations" >
			<md5file name="index.php">aebee38471268bb7b437690f47aa3d80</md5file>
		</dir>
	</dir>

 

 

 

Aucun

 

<dir name="fr " > ou   <dir name="it" >

etc... comme dans l'ancienne version....

 

Quelqu'un pourrait-il me passer son fichier 1.5.4.1.xml ou bien voir si le mien correspond au votre ?

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

Pour avancer un peu (avec toutes ces réponses je ne sais plus où donner de la tête....), j'ai activé l'allemand, l'italien, et ceux-là fonctionnent !!!

 

Si cela peut donner une idée à quelqu'un du comment du pourquoi il ne trouve pas la page en français ????

Link to comment
Share on other sites

  • 2 weeks later...

La solution est dans ce sujet en Anglais :

http://www.prestasho...is-not-working/

 

Traduction en Français :

Vous pouvez résoudre ce problème dans le fichier "modules/sendtoafriend/sendtoafriend-extra.tpl"

replacer ligne 48

data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/u/g, '%u'))},{/literal}{literal}

par

data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: JSON.stringify(datas)},{/literal}{literal}

 

Cela fonctionne maintenant chez moi.

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

Bonjour Japanas,

 

Merci pour votre réponse, j'allais juste poster moi-même ici la solution que je viens de tester et qui fonctionne (qui ressemble à la votre) :

Dans le fichier que vous indiquez (modules/sendtoafriend/sendtoafriend-extra.tpl)

 

Remplacer

 

   	 else
           $('#send_friend_form_error').text('{/literal}{l s='You did not fill required fields' mod='sendtoafriend'}{literal}');

 

par

 

   	 else
           $('#send_friend_form_error').text("{/literal}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{literal}");

Link to comment
Share on other sites

  • 1 month later...

Même type de soucis en version 1.5.4.1 sauf que si j'apporte la modif de KAROPRESTA une page blanche gele mes fiche produits.

 

Mon éditeur (dreamweaver) trouve lui une erreur à la ligne 45 mais je ne sais quoi faire:

 

 

<script text="javascript">

{literal}

$('document').ready(function(){

$('#send_friend_button').fancybox({

'hideOnContentClick': false

});

 

$('#sendEmail').click(function(){

var datas = [];

$('#fancybox-content').find('input').each(function(index){

var o = {};

o.key = $(this).attr('name');

o.value = $(this).val();

if (o.value != '')

datas.push(o);

});

if (datas.length >= 3)

{

$.ajax({

{/literal}url: "{$module_dir}sendtoafriend_ajax.php",{literal}

type: "POST",

headers: {"cache-control": "no-cache"},

data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/u/g, '%u'))},{/literal}{literal}

dataType: "json",

success: function(result){

$.fancybox.close();

}

});

}

else

$('#send_friend_form_error').text("{/literal}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{literal}");

});

});

{/literal}

</script>

Link to comment
Share on other sites

  • 1 month later...

Qué bazar ...)))

Que suis-je venu faire dans cette galère de Prestashop ?

A force de corriger, corriger, corriger... mais on n'est plus sous Prestashop !

On est sur "ici chez moi"

...)))

Allo la terre ??

i am not here right now

Répond la lune.

 

Question de traduction?

Non !

De marge sur les addons?

 

Ah... une piste ?

 

Qué bazar Qué bins !

 

Quand j'aurais fini d' overrider, je ferai signe

C'est à dire :

Quant je sera Grand.

Trouver l'erreur dans l'affirmation ci-dessus est sans aucun doute plus aisé que de simplement trouver où est la faille dans une des innombrables bizarreries de la SOLUTION Prestashop.

 

Un Grand merci toutefois à Presta !

A force de chercher, on fini par trouver des trucs auxquels on n'aurait jamais penser !

 

Mais bon, c'était pas non plus mon but premier que de consacrer autant de temps et de fric !

 

Bin quoi ?

 

S'exprimer ici c'est moins cher que chez le Psy !

Non ?

 

Allez.. good luck  comme disait le précédent Président

Du moins, c'était LUI me semble-t-il

 

Bayou bayou...

Link to comment
Share on other sites

  • 5 months later...

Mise à jour du Module

voici le nouveau fichier tpl

cette ligne qui a changé apparemment !

                * data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', name: name, email: email, id_product: id_product},{/literal}{literal}
 

Mais cela ne marche pas

Quelqu'un a une idée ? :)

 

 

 

 

<script type="text/javascript">
{literal}
$('document').ready(function(){
    $('#send_friend_button').fancybox({
        'hideOnContentClick': false
    });

    $('#sendEmail').click(function(){
        
        var name = $('#friend_name').val();
        var email = $('#friend_email').val();
        var id_product = $('#id_product_comment_send').val();
        if (name && email && !isNaN(id_product))
        {
            $.ajax({
                {/literal}url: "{$module_dir}sendtoafriend_ajax.php",{literal}
                type: "POST",
                headers: {"cache-control": "no-cache"},
                * data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', name: name, email: email, id_product: id_product},{/literal}{literal}
                data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: JSON.stringify(datas)},{/literal}{literal}
                dataType: "json",
                success: function(result) {
                    $.fancybox.close();
                    var msg = result ? "{/literal}{l s='Your e-mail has been sent successfully' mod='sendtoafriend'}{literal}" : "{/literal}{l s='Your e-mail could not be sent. Please check the e-mail address and try again.' mod='sendtoafriend'}{literal}";
                    var title = "{/literal}{l s='Send to a friend' mod='sendtoafriend'}{literal}";
                    fancyMsgBox(msg, title);
                }
            });
        }
        else
            $('#send_friend_form_error').text("{/literal}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{literal}");
    });
});
{/literal}
</script>
<li class="sendtofriend">
    <a id="send_friend_button" href="#send_friend_form">{l s='Send to a friend' mod='sendtoafriend'}</a>
</li>

<div style="display: none;">
    <div id="send_friend_form">
            <h2 class="title">{l s='Send to a friend' mod='sendtoafriend'}</h2>
            <div class="product clearfix">
                <img src="{$link->getImageLink($stf_product->link_rewrite, $stf_product_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$stf_product->name|escape:html:'UTF-8'}" />
                <div class="product_desc">
                    <p class="product_name"><strong>{$stf_product->name}</strong></p>
                    {$stf_product->description_short}
                </div>
            </div>
            
            <div class="send_friend_form_content" id="send_friend_form_content">
                <div id="send_friend_form_error"></div>
                <div id="send_friend_form_success"></div>
                <div class="form_container">
                    <p class="intro_form">{l s='Recipient' mod='sendtoafriend'} :</p>
                    <p class="text">
                        <label for="friend_name">{l s='Name of your friend' mod='sendtoafriend'} <sup class="required">*</sup> :</label>
                        <input id="friend_name" name="friend_name" type="text" value=""/>
                    </p>
                    <p class="text">
                        <label for="friend_email">{l s='E-mail address of your friend' mod='sendtoafriend'} <sup class="required">*</sup> :</label>
                        <input id="friend_email" name="friend_email" type="text" value=""/>
                    </p>
                    <p class="txt_required"><sup class="required">*</sup> {l s='Required fields' mod='sendtoafriend'}</p>
                </div>
                <p class="submit">
                    <input id="id_product_comment_send" name="id_product" type="hidden" value="{$stf_product->id}" />
                    <a href="#" onclick="$.fancybox.close();">{l s='Cancel' mod='sendtoafriend'}</a> {l s='or' mod='sendtoafriend'} 
                    <input id="sendEmail" class="button" name="sendEmail" type="submit" value="{l s='Send' mod='sendtoafriend'}" />
                </p>
            </div>
    </div>
</div>

Link to comment
Share on other sites

  • 9 months later...

Bonjour a tous,

 

moi j'au une version 1.7.2 de envoyer à un ami sur un presta 1.6.0.9 et ce module ne fonctionne pas non plus, j'ai cette erreur :

 

"Envoyer à un ami

Votre e-mail n'a pas pu être envoyé. Veuillez vérifier l'adresse et réessayer."

 

Un avis ? une solution ou une idée ?

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...