DESCRITIF DE LA COMMANDE DANS LE MAIL

47 posts in this topic

Posted · Report post

Des fois c'est bien d'être rapide, mais d'autres non :) <_< :P :P

Remplacez:

	$qid = mysql_query("SELECT * FROM  peel_commandes_articles WHERE commande_id = $commandeid");
Par:
	$qid = mysql_query("SELECT * FROM  peel_commandes_articles WHERE commande_id = '" .$commandeid ."'");
et si ca ne marche pas on va tracer l'erreur et remplacer:
$qid = mysql_query("SELECT * FROM  peel_commandes_articles WHERE commande_id = $commandeid");


	if ($qid) {


		if (mysql_num_rows($qid) > 0) {


			while ($cat =  mysql_fetch_array($qid)) {


				$email_object 1.= $cat['quantite'] ." * " .$cat['nom_produit'] ."  " .$cat['produit_id'] ."  " .$cat['prix'] ." Euros " .$cat['couleur'] ."  " .$cat['taille'] ."  " .$cat['comment'] ."\n\r";

				$email_object1 .= "\n\r";


			}

		}

	}
Par:
$qid = mysql_query("SELECT * FROM  peel_commandes_articles WHERE commande_id = '" .$commandeid ."'");


	if ($qid) {


		if (mysql_num_rows($qid) > 0) {


			while ($cat =  mysql_fetch_array($qid)) {


				$email_object 1.= $cat['quantite'] ." * " .$cat['nom_produit'] ."  " .$cat['produit_id'] ."  " .$cat['prix'] ." Euros " .$cat['couleur'] ."  " .$cat['taille'] ."  " .$cat['comment'] ."\n\r";

				$email_object1 .= "\n\r";


			}

			$email_object1 .= "... ... ... \n\r	\n\r";

		}

		else{

			$email_object1 .= "Sortie de if (mysql_num_rows($qid) > 0) \n\r  \n\r";

		}

	}

	else{

		$email_object1 .= "Sortie de if ($qid) \n\r  \n\r";

	}

Et dites moi ce que ca sort s'il ne met pas le detail de la commande.

Willy

Share this post


: post
Share on other sites

Posted · Report post

Avec quel code ?

pas d'erreur à l'écran ? pas de mail, page blanche ?

Willy

bon j'ai essayer avec le code juste au dessus , celui de olch : voila ce que j'ai recu :

----------------------------------------------------------------------

Numero de la commande : 579

Montant de la commande : 315,00 EUR TTC

1 * COFFRET DE CHANTIER POUR COMPTAGE PROVISOIRE TARIF BLEU MONO ( VENTE ) 1096 315.00 Euros sortie sur prise 16 A + bornes

Bon de commande : http://www.electricite-online.com/factures...26+00%3A32%3A15

Merci d'envoyer votre règlement figurant à l'adresse figurant sur cette facture(tout reglement par cheque doit etre libelle a l ordre de SARL 'pas important)

Nous vous remercions pour votre confiance

L'équipe du site Electricite-online.

-----------------------------------------------------

à noter que j'ai recu le mail pour l'administrateur du site !!!!

-------------------------------------------------------

avec la modif de willy jai eu sa :

Warning: Cannot use a scalar value as an array in /home/electric/www/achat/achat_maintenant.php on line 74

Warning: Cannot use a scalar value as an array in /home/electric/www/achat/achat_maintenant.php on line 76

Warning: Cannot use a scalar value as an array in /home/electric/www/achat/achat_maintenant.php on line 78

Warning: Cannot use a scalar value as an array in /home/electric/www/achat/achat_maintenant.php on line 80

Warning: Cannot use a scalar value as an array in /home/electric/www/achat/achat_maintenant.php on line 82

Share this post


: post
Share on other sites

Posted · Report post

Bon ba voila j'y connais rien jai voulu faire le grand garcon et mintenant y a plus rien qui marche !!!

au secour !!!!

sa me met un message d'erreur sur le fichier " haut " ligne 465 et pourtant j'ai pas toucher a ce fichier !!!

Share this post


: post
Share on other sites

Posted · Report post

tu as essayé de remettre ton fichier d'origine?

Share this post


: post
Share on other sites

Posted · Report post

tu as essayé de remettre ton fichier d'origine?

oui

j ai sur le serveur tous les fichiers d'origine , jamais modifiés et sa fait la meme chose , ce que je ne m'explique pas c'est que le fichier haut est ... en defaut alors que je n'ai toucher qu'au fichier /fonction / fonction.php

je suis vraiment dans la mer...e !!!!

Share this post


: post
Share on other sites

Posted · Report post

Voici ma ligne 465 du fichier haut.php

	echo REMISE." : ".$_SESSION['utilisateur']['remise_percent']." %";

Share this post


: post
Share on other sites

Posted · Report post

FIN DU PROBLEME !!

merci à tous de votre aide !

je vais vous dire ce que j'avais , j'ai honte mais bon

j'ai remis sur le serveur le fichier " fonctions " mais sans le s final !!!

ba 1 " s " sa fait tout !!!! :)

encore merci à tous

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

est ce possible de rajouter en plus le nom de l'objet commandé ??

si oui comment, j'ai laché le code peel 1 mois..

Merci d'une aide précieuse...

à bientôt...

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

est ce possible de rajouter en plus le nom de l'objet commandé ??

si oui comment, j'ai laché le code peel 1 mois..

Merci d'une aide précieuse...

à bientôt...

si tu met le code du message 26 au dessus tu verra que l'objet y est dans le mail comme je le souligne dans le message 27 ( toujour au dessus !!)

@+

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

au final ça fonctionne ou non ? :)

Willy

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

au final ça fonctionne ou non ? :)

Willy

oui !!

merci willy <_<

Share this post


: post
Share on other sites

Posted · Report post

Cool !

Je pense qu'il faut mettre le code qui marche, car il y a plusieurs version ici, j'ai codé un peu vite et du coup 2-3 boulettes :)

Willy

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

je vais tester ça et je vous donne suite !!

j'ai justement un site de test...

à bientôt...

Share this post


: post
Share on other sites

Posted · Report post

Serait-il possible de poster le vrai bon code une bonne fois pour toute parce qu'avec tout ces code de partout je suis perdu...

Par avance merci

Share this post


: post
Share on other sites

Posted · Report post

Au final:

Quel est le code?

Merci par avance michel

Share this post


: post
Share on other sites

Posted · Report post

Au final:

Quel est le code?

Merci par avance michel

un ti up !!

Share this post


: post
Share on other sites

Posted · Report post

olch ?

peux tu mettre ton code s'il fonctionne ? ;)

Willy

Share this post


: post
Share on other sites

Posted · Report post

oui !!

merci willy ;)

Apparement ca marche chez phil :)

Chez moi j'avais une page blanche dans back office vente, j'ai surement oublié un ! quelque part :D

Depuis lors je suis a l'encodage des articles mais je reviendrais la dessus quand ce sera terminé :D

Guillaume

Share this post


: post
Share on other sites

Posted · Report post

Comme il n'y avait pas de réponse j'ai testé et installé cette fonction sur mon site ;)

Voila mon code qui remplace cette même fonction dans lib/fonctions/fonctions.php

function email_commande(&$commandeid) {


	global $wwwroot;

	global $site;

	global $support;

	global $langfile;


	$result = mysql_query("SELECT * FROM peel_commandes WHERE id ='".$commandeid."'");


	$com = mysql_fetch_object($result);


	$timestamp = $com->o_timestamp;


	$montant = $com->montant;


	$goto = "/factures/facture_html.php?mode=proforma&id=$commandeid&timestamp=".urlencode($timestamp)."";


	$urlcommande = $wwwroot.$goto;


	# Mail d'information envoy&eacute; &agrave; l'administrateur - ENVOYER EN LANGUE FRANCAISE UNIQUEMENT




	$email_subject = EMAIL_ORDER_CONFIRMATION;

	$email_object = EMAIL_ORDER_MESSAGE."\n\r";

	$email_object .= "\n\r";

	$email_object .= EMAIL_ORDER_DATE." : ".return_date_fr($timestamp)."\n\r";

	$email_object .= "\n\r";

	$email_object .= EMAIL_ORDER_NUMBER." : ".$commandeid."\n\r";

	$email_object .= "\n\r";

	$email_object .= EMAIL_ORDER_AMOUNT." : ".fprix($montant)." EUR TTC\n\r";

	$email_object .= "\n\r";


	$email_object1 = $email_object;



	$qid = mysql_query("SELECT * FROM  peel_commandes_articles,peel_produits WHERE peel_produits.id=peel_commandes_articles.produit_id AND commande_id = '" .$commandeid ."'");


	if ($qid) {


		if (mysql_num_rows($qid) > 0) {


			while ($cat =  mysql_fetch_array($qid)) {


				$email_object1 .= $cat['quantite'] ." * " .$cat['nom_produit'] ." (ref. : ".$cat['reference_fournisseur'] .") ".$cat['prix'] ." Euros " .$cat['couleur'] ."  " .$cat['taille'] ."  " .$cat['comment'] ."\n\r";

				$email_object1 .= "\n\r";


			}

		}

	}


	mail(

		$support,

		"Nouvelle commande sur votre site web $site",

		$email_object1,

		"FROM:$support");	


	if ($com->paiement != CB) {


	$email_object .= EMAIL_ORDER_PROFORMA." : ".$urlcommande."\n\r";

	$email_object .= "\n\r";

	}


	$email_object .= EMAIL_THANKS."\n\r";


	mail($com->email,$email_subject,$email_object,"FROM:$support");		


}]

Pour moi seul l'admin recoit l'email avec le detail, si vous voulez que le client le recoive aussi remplacez les $email_object1 par $email_object et supprimez la ligne $email_object1 = $email_object;

Willy

Share this post


: post
Share on other sites

Posted · Report post

Comme il n'y avait pas de réponse j'ai testé et installé cette fonction sur mon site ;)

Voila mon code qui remplace cette même fonction dans lib/fonctions/fonctions.php

[codefunction email_commande(&$commandeid) {

global $wwwroot;
global $site;
global $support;
global $langfile;

$result = mysql_query("SELECT * FROM peel_commandes WHERE id ='".$commandeid."'");

$com = mysql_fetch_object($result);

$timestamp = $com->o_timestamp;

$montant = $com->montant;

$goto = "/factures/facture_html.php?mode=proforma&id=$commandeid&timestamp=".urlencode($timestamp)."";

$urlcommande = $wwwroot.$goto;

# Mail d'information envoy&eacute; &agrave; l'administrateur - ENVOYER EN LANGUE FRANCAISE UNIQUEMENT



$email_subject = EMAIL_ORDER_CONFIRMATION;
$email_object = EMAIL_ORDER_MESSAGE."\n\r";
$email_object .= "\n\r";
$email_object .= EMAIL_ORDER_DATE." : ".return_date_fr($timestamp)."\n\r";
$email_object .= "\n\r";
$email_object .= EMAIL_ORDER_NUMBER." : ".$commandeid."\n\r";
$email_object .= "\n\r";
$email_object .= EMAIL_ORDER_AMOUNT." : ".fprix($montant)." EUR TTC\n\r";
$email_object .= "\n\r";

$email_object1 = $email_object;


$qid = mysql_query("SELECT * FROM peel_commandes_articles,peel_produits WHERE peel_produits.id=peel_commandes_articles.produit_id AND commande_id = '" .$commandeid ."'");

if ($qid) {

if (mysql_num_rows($qid) > 0) {

while ($cat = mysql_fetch_array($qid)) {

$email_object1 .= $cat['quantite'] ." * " .$cat['nom_produit'] ." (ref. : ".$cat['reference_fournisseur'] .") ".$cat['prix'] ." Euros " .$cat['couleur'] ." " .$cat['taille'] ." " .$cat['comment'] ."\n\r";
$email_object1 .= "\n\r";

}
}
}

mail(
$support,
"Nouvelle commande sur votre site web $site",
$email_object1,
"FROM:$support");

if ($com->paiement != CB) {

$email_object .= EMAIL_ORDER_PROFORMA." : ".$urlcommande."\n\r";
$email_object .= "\n\r";
}

$email_object .= EMAIL_THANKS."\n\r";

mail($com->email,$email_subject,$email_object,"FROM:$support");

}]

Pour moi seul l'admin recoit l'email avec le detail, si vous voulez que le client le recoive aussi remplacez les $email_object1 par $email_object et supprimez la ligne $email_object1 = $email_object;

Willy

Bonjour Willy,

Votre code fonctionne sur ma version 3.8

Merci pour votre travail

Cordialement,

Balam

Share this post


: post
Share on other sites

Posted · Report post

Bonjour willy

Pourrais tu éditer ton message ;)

Il manque un ]

[codefunction

Encore merci pour le code

Guillaume

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

Merci mais je n'avait pas eu le temps de le mettre en test...

à bientôt...

Share this post


: post
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

Twitter Advisto ecommerce

Facebook PEEL Shopping