-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
173 lines (142 loc) · 6.48 KB
/
index.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
include_once "php/header.php";
?>
<!--============================================================================================-->
<div class="hero1">
<div class="hero_left">
<h1 class="hero_text"> Natural products that make a difference</h1>
<a href="#products" class="btn1 hero_button">SHOP NOW!</a>
</div>
<div class="hero_img hero_right">
<img src="media/hero.jpg" alt="hero">
</div>
</div>
<!-- products-->
<section id="products" class="section">
<div class="title1">
<h1 >Our Products</h1>
</div>
<div class="title2">
<p>A story of nature and beauty</p>
</div>
<div class="row">
<div class="col">
<div class="item">
<img src="media/item1.jpg" alt="item1">
<div class="pName">Purifying Serum</div>
<div class="price">
<h3 class="price">$13.99</h3>
</div>
<form action="php/cart.pro.php" method="post" class="ajax_form">
<input type="hidden" name="pName" value="Purifying Serum">
<input type="hidden" name="price" value="13.99">
<input type="hidden" name="img" value="media/item1.jpg">
<input type="hidden" name="id" value="item1">
<button type="submit" class="btn2" >Add to Cart</button>
</form>
</div>
</div>
<div class="col">
<div class="item">
<img src="media/item2.jpg" alt="item1">
<div class="pName">Detox Serum</div>
<div class="price">
<h3 class="price">$11.99</h3>
</div>
<form action="php/cart.pro.php" method="post" class="ajax_form">
<input type="hidden" name="pName" value="Detox Serum">
<input type="hidden" name="price" value="11.99">
<input type="hidden" name="img" value="media/item2.jpg">
<input type="hidden" name="id" value="item2">
<button type="submit" class="btn2" >Add to Cart</button>
</form>
</div>
</div>
<div class="col">
<div class="item">
<img src="media/item3.jpg" alt="item1">
<div class="pName">Deep Sweep</div>
<div class="price">
<h3 class="price">$15.99</h3>
</div>
<form action="php/cart.pro.php" method="post" class="ajax_form">
<input type="hidden" name="pName" value="Deep Sweep">
<input type="hidden" name="price" value="15.99">
<input type="hidden" name="img" value="media/item3.jpg">
<input type="hidden" name="id" value="item3">
<button type="submit" class="btn2" >Add to Cart</button>
</form>
</div>
</div>
</div>
<div class="row container">
<div class="col">
<div class="item">
<img src="media/item4.jpg" alt="item1">
<div class="pName">Pore Purifying</div>
<div class="price">
<h3 class="price">$17.99</h3>
</div>
<form action="php/cart.pro.php" method="post" class="ajax_form">
<input type="hidden" name="pName" value="Pore Purifying">
<input type="hidden" name="price" value="17.99">
<input type="hidden" name="img" value="media/item4.jpg">
<input type="hidden" name="id" value="item4">
<button type="submit" class="btn2" >Add to Cart</button>
</form>
</div>
</div>
<div class="col">
<div class="item">
<img src="media/item5.jpg" alt="item1">
<div class="pName">Facial Serum</div>
<div class="price">
<h3 class="price">$17.99</h3>
</div>
<form action="php/cart.pro.php" method="post" class="ajax_form">
<input type="hidden" name="pName" value="Facial Serum">
<input type="hidden" name="price" value="17.99">
<input type="hidden" name="img" value="media/item5.jpg">
<input type="hidden" name="id" value="item5">
<button type="submit" class="btn2" >Add to Cart</button>
</form>
</div>
</div>
<div class="col">
<div class="item">
<img src="media/item6.jpg" alt="item1">
<div class="pName">Facial Treatment</div>
<div class="price">
<h3 class="price">$17.99</h3>
</div>
<form action="php/cart.pro.php" method="post" class="ajax_form">
<input type="hidden" name="pName" value="Facial Treatment">
<input type="hidden" name="price" value="17.99">
<input type="hidden" name="img" value="media/item6.jpg">
<input type="hidden" name="id" value="item6">
<button type="submit" class="btn2">Add to Cart</button>
</form>
</div>
</div>
</div>
</section>
<div class="center-hero">
<div class="hero_img2">
<h1 class="hero_text"> Our best products</h1>
<a href="#products" class="btn3 hero_button">SHOP NOW</a>
</div>
</div>
<?php
include_once 'php/footer.php';
?>
<script src="js/ajax.js" > </script>
<script>
let btn2List = document.querySelectorAll(".btn2");
let cart = document.getElementById("cartHeader");
for (let b2 of btn2List){
b2.addEventListener('click', function(){
let count = Number(cart.textContent)+1;
cart.textContent = count;
})
}
</script>