Bonjour
J’ai créé un site commerce avec Dreamweaver CS3 à grâce le livre de Le Campus. Mais dans le livre qu'il ne nous montre pas comment calculer le frais de port. C'est pour cette raison dont j'ai besoins l'aide.
ça fait 1 semaine que J'ai posté ce sujet sur forum Dreamweaver http://www.developpez.net/forums/d75...er-frais-port/ mais je n'ai pas de réponse.

je suis presque finir la page panier qu'il y a encore dernier truc que je ne sache pas comment faire la commande moin de 60€ le prix de port gratuit (= o)

J'ai essayé avec ce code mais ça ne marche pas

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
if ($row_TotalPanier['total_ttc'] < 60)
{
$row_TotalPanier['shop_panier.port'] = 7;
}
else
{
$row_TotalPanier['shop_panier.port'] = 0;
}

Mes codes dans ma page panier.php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$paramClient_VoirPanier = "0";
if (isset($_SESSION['MM_Username'])) {
  $paramClient_VoirPanier = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_HvdBoutique, $HvdBoutique);
$query_VoirPanier = sprintf("SELECT shop_panier.*, shop_livres.titre, shop_livres.photo, shop_livres.prix_ttc, (shop_livres.prix_ttc* shop_panier.quantite) AS total_ttc FROM shop_panier INNER JOIN shop_livres ON shop_panier.article=shop_livres.id_livres WHERE client = %s", GetSQLValueString($paramClient_VoirPanier, "text"));
$VoirPanier = mysql_query($query_VoirPanier, $HvdBoutique) or die(mysql_error());
$row_VoirPanier = mysql_fetch_assoc($VoirPanier);
$totalRows_VoirPanier = mysql_num_rows($VoirPanier);
 
$paramClient_TotalPanier = "0";
if (isset($_SESSION['MM_Username'])) {
  $paramClient_TotalPanier = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_HvdBoutique, $HvdBoutique);
$query_TotalPanier = sprintf("SELECT now() AS date, SUM(shop_panier.quantite*shop_livres.prix_ttc+shop_panier.port) AS total_ttc, shop_panier.port FROM shop_panier INNER JOIN shop_livres ON shop_livres.id_livres = shop_panier.article WHERE shop_panier.client = %s GROUP BY shop_panier.client", GetSQLValueString($paramClient_TotalPanier, "text"));
$TotalPanier = mysql_query($query_TotalPanier, $HvdBoutique) or die(mysql_error());
$row_TotalPanier = mysql_fetch_assoc($TotalPanier);
$totalRows_TotalPanier = mysql_num_rows($TotalPanier);
 
if ($row_TotalPanier['total_ttc'] < 60)
{
$row_TotalPanier['shop_panier.port'] = 7;
}
else
{
$row_TotalPanier['shop_panier.port'] = 0;
}
Est ce que vous pourrez m'aider s'il vous plait

Merci A+