-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraccourciPanier.php
87 lines (68 loc) · 2.78 KB
/
raccourciPanier.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
//session_start();
function afficherPanier()
{
$prices=0;
?>
<div class="cart">
<p>Welcome to our Online Store! <span>Cart:</span><div id="dd" class="wrapper-dropdown-2">
<?php
if (isset($_SESSION['panier']))
{
echo count($_SESSION['panier']['idProduit']).' ';
}
else
echo "0 ";
?>
article(s)
<?php
if (isset($_SESSION['panier']))
{
// ($_SESSION['panier']['idProduit']);
// ($_SESSION['panier']['prixProduit']);
// $_SESSION['panier']['prixProduit']= array();
// $_SESSION['panier']['idProduit']=array();
// $_SESSION['panier']['qte']=array();
// ($_SESSION['panier']['qte']);
foreach ($_SESSION['panier']['idProduit']as $key => $value) {
$prices+=$_SESSION['panier']['prixProduit'][$key]*$_SESSION['panier']['qte'][$key];
}
}
echo "-".$prices." ";
?> TND
<ul class="dropdown">
<?php
if (isset($_SESSION['panier']))
{
if (count($_SESSION['panier']['idProduit'])>0) {
foreach ($_SESSION['panier']['idProduit']as $key => $value) {
?>
<li>
<div class="steps clearfix">
<label style="display: block; width: 150px; float: Left"><?php
echo $value." x ".$_SESSION['panier']['qte'][$key]." = ".$_SESSION['panier']['qte'][$key]*$_SESSION['panier']['prixProduit'][$key];
?>
</label>
<div>
<a href=<?php
echo '"supprimerArticle.php?idProduit='.$value.'"';
?> class= "btn btn-danger" ><i class="glyphicon glyphicon-remove"></i></a>
</div>
</div>
</li>
<?php
}
}
}
else if (!isset($_SESSION['panier']) or count($_SESSION['panier']['idProduit'])==0)
echo "you have no items in your Shopping cart ";
?>
<div>
<a href="consulterPanier.php" class="btn btn-success"><span class="glyphicon glyphicon-shopping-cart"></span> View Cart</a>
</div>
</li>
</ul></div></p>
</div>
<?php
}
?>