nopcart winkelwagen sript
Ik heb een winkelwagentje sript van nopcart ingebouwd in mijn webshop.
Het winkelwagentje werkt, maar ik krijg de data van de bestelling als ook de gegevens van de
klant niet verzonden naar mijn email.
Het is ook de bedoeling dat de klant ook een mail met de data van de bestelling krijgt,
ook dat krijg ik niet werkend.
Het verzenden van de data gaat via headers.html, zie onderstaande script:
Code (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<script type="text/javascript" src="language-nl.js"></script>
<script type="text/javascript" src="nopcart.js"></script>
De volgende prudukten zitten in het winkelwagentje:
<FORM ACTION="./checkout2.php" METHOD="GET" onsubmit="return ValidateCart(this)">
<SCRIPT>
ManageCart();
</SCRIPT>
<TABLE >
<TR><TD>Naam: </TD><TD><input type="text" size="18" name="b_first" /> <input type="text" size="15" name="b_last" /></TD></TR>
<TR><TD>Adres: </TD><TD><input type="text" size="37" name="b_addr" /> </TD></TR>
<TR><TD>Adres: </TD><TD><input type="text" size="37" name="b_addr2" /></TD></TR>
<TR>
<TD>Woonlaats: </TD>
<TD><input type="text" size="21" name="b_city" /> </TD></TR>
<TR><TD>Postcode: </TD><TD><input type="text" size="5" name="b_zip" /></TD></TR>
<TR><TD>Telefoon: </TD><TD><input type="text" size="37" name="b_phone" /></TD></TR>
<TR><TD>Email: </TD><TD><input type="text" size="37" name="b_email" /> </TD></TR>
</TABLE>
<p> </p>
<p>
<INPUT type=SUBMIT value=" Versturen " />
</p>
</FORM>
<!--Shopping Cart ManageCart End -->
Deze gegevens worden zoals je ziet naar checkout2.php gestuurd, dan was het de bedoeling dat checkout2.php deze data door stuurt naar de mail
Zie onderstaande sript van checkout2.php
<title>checkout2</title>
<?php
//=====================================================================||
// NOP Design JavaScript Shopping Cart ||
// PHP SCRIPT Checkout Module ||
// ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com ||
// ||
// Javascript portions of this shopping cart software are available as ||
// freeware from NOP Design. You must keep this comment unchanged in ||
// your code. For more information contact [email protected]. ||
// ||
// JavaScript Shop Module, V.4.4.0 ||
//=====================================================================||
// ||
// Function: Writes available form elements from the NOP ||
// Free Cart (http://www.nopdesign.com/freecart) ||
// and other form elements to an email file, and ||
// send user confirmation ||
// ||
//=====================================================================||
//######################################################################
// #
// User defined variables: #
// $header - string value containing the complete #
// path of the HTML page header #
// $footer - string value containing the complete #
// path of the HTML page footer #
// $youremail - string value containing the email address to #
// send catalog orders in EMAIL or BOTH modes #
// $returnpage - URL to send user when checkout is complete #
// $csvfilename - string value containing the complete #
// path of the user database. #
// $csvquote - string value containing what to use for quotes #
// in the csv file (typically "" or \") #
// $mode - string value containing 'EMAIL', 'FILE' or #
// 'BOTH' to determine if the script should send #
// an email to you with the new order, write the #
// order to a CSV file, or do both. #
//######################################################################
$header = "header.html";
$footer = "footer.html";
$returnpage = "/";
$youremail = "********";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";
$today = date ("l, F jS Y");
$strMessageBody = "";
$strMessageBody .= "A new order has been received. A summary of this order appears below.\n";
$strMessageBody .= "\n";
$strMessageBody .= "Order Date: $today \n";
$strMessageBody .= " \n";
$strMessageBody .= "Bill To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $b_first $b_last: \n";
$strMessageBody .= " $b_addr \n";
$strMessageBody .= " $b_addr2 \n";
$strMessageBody .= " $b_city, $b_state $b_zip \n";
$strMessageBody .= " $b_phone \n";
$strMessageBody .= " $b_fax \n";
$strMessageBody .= " $b_email \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Ship To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $s_first $s_last \n";
$strMessageBody .= " $s_addr \n";
$strMessageBody .= " $s_addr2 \n";
$strMessageBody .= " $s_city, $s_state $s_zip \n";
$strMessageBody .= " $s_phone \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Qty Price(\$) Product ID - Product Name\n";
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n";
if( $NAME_2 ) {$strMessageBody .= "$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";}
if( $NAME_3 ) {$strMessageBody .= "$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";}
if( $NAME_4 ) {$strMessageBody .= "$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";}
if( $NAME_5 ) {$strMessageBody .= "$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";}
if( $NAME_6 ) {$strMessageBody .= "$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";}
if( $NAME_7 ) {$strMessageBody .= "$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";}
if( $NAME_8 ) {$strMessageBody .= "$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";}
if( $NAME_9 ) {$strMessageBody .= "$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";}
if( $NAME_10 ){$strMessageBody .= "$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";}
if( $NAME_11 ){$strMessageBody .= "$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";}
if( $NAME_12 ){$strMessageBody .= "$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";}
if( $NAME_13 ){$strMessageBody .= "$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";}
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "SUBTOTAL: $SUBTOTAL \n";
$strMessageBody .= "TOTAL: $TOTAL \n";
$strMessageBody .= "\n";
$strMessageBody .= "FREIGHT: $SHIPPING \n";
$strMessageBody .= "\n\n";
$strMessageBody .= "Comments: \n";
$strMessageBody .= "--------- \n";
$strMessageBody .= "$comment \n";
$strMessageBody .= " \n";
if( $mode == "BOTH" || $mode == "EMAIL") {
//# Send email order to you...
$mailheaders = "From: $b_email\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "New Online Order";
mail($youremail, $subject, $strMessageBody, $mailheaders);
}
if( $mode == "BOTH" || $mode == "FILE") {
$csvcomments = $comment;
if (!$CSVF = fopen($csvfilename,'a')) {
doError("Unable to open CSV file for writing. Your order has not been saved.");
exit;
}
fputs($CSVF, $string);
fputs($CSVF, "\"");
fputs($CSVF, "$today");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_first");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_last");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_addr");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_addr2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_city");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_state");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_zip");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_phone");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_fax");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_email");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_first");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_last");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_addr");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_addr2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_city");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_state");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_zip");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_phone");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$SUBTOTAL");
fputs($CSVF, "\",\"");
fputs($CSVF, "$TOTAL");
fputs($CSVF, "\",\"");
fputs($CSVF, "$SHIPPING");
fputs($CSVF, "\",\"");
fputs($CSVF, "$comment");
fputs($CSVF, "\"\n");
fclose($CSVF);
}
//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);
include($header);
echo "<h2>Thank you</h2>";
echo "Thank you for your order from our online store. You will receive a confirmation email of your order ";
echo "momentarily. Please contact us at $youremail if you have any questions or concerns.";
echo "<P>";
echo "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
echo "<P>";
include($footer);
?>
<script type="text/javascript" src="nopcart.js"></script>
De volgende prudukten zitten in het winkelwagentje:
<FORM ACTION="./checkout2.php" METHOD="GET" onsubmit="return ValidateCart(this)">
<SCRIPT>
ManageCart();
</SCRIPT>
<TABLE >
<TR><TD>Naam: </TD><TD><input type="text" size="18" name="b_first" /> <input type="text" size="15" name="b_last" /></TD></TR>
<TR><TD>Adres: </TD><TD><input type="text" size="37" name="b_addr" /> </TD></TR>
<TR><TD>Adres: </TD><TD><input type="text" size="37" name="b_addr2" /></TD></TR>
<TR>
<TD>Woonlaats: </TD>
<TD><input type="text" size="21" name="b_city" /> </TD></TR>
<TR><TD>Postcode: </TD><TD><input type="text" size="5" name="b_zip" /></TD></TR>
<TR><TD>Telefoon: </TD><TD><input type="text" size="37" name="b_phone" /></TD></TR>
<TR><TD>Email: </TD><TD><input type="text" size="37" name="b_email" /> </TD></TR>
</TABLE>
<p> </p>
<p>
<INPUT type=SUBMIT value=" Versturen " />
</p>
</FORM>
<!--Shopping Cart ManageCart End -->
Deze gegevens worden zoals je ziet naar checkout2.php gestuurd, dan was het de bedoeling dat checkout2.php deze data door stuurt naar de mail
Zie onderstaande sript van checkout2.php
<title>checkout2</title>
<?php
//=====================================================================||
// NOP Design JavaScript Shopping Cart ||
// PHP SCRIPT Checkout Module ||
// ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com ||
// ||
// Javascript portions of this shopping cart software are available as ||
// freeware from NOP Design. You must keep this comment unchanged in ||
// your code. For more information contact [email protected]. ||
// ||
// JavaScript Shop Module, V.4.4.0 ||
//=====================================================================||
// ||
// Function: Writes available form elements from the NOP ||
// Free Cart (http://www.nopdesign.com/freecart) ||
// and other form elements to an email file, and ||
// send user confirmation ||
// ||
//=====================================================================||
//######################################################################
// #
// User defined variables: #
// $header - string value containing the complete #
// path of the HTML page header #
// $footer - string value containing the complete #
// path of the HTML page footer #
// $youremail - string value containing the email address to #
// send catalog orders in EMAIL or BOTH modes #
// $returnpage - URL to send user when checkout is complete #
// $csvfilename - string value containing the complete #
// path of the user database. #
// $csvquote - string value containing what to use for quotes #
// in the csv file (typically "" or \") #
// $mode - string value containing 'EMAIL', 'FILE' or #
// 'BOTH' to determine if the script should send #
// an email to you with the new order, write the #
// order to a CSV file, or do both. #
//######################################################################
$header = "header.html";
$footer = "footer.html";
$returnpage = "/";
$youremail = "********";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";
$today = date ("l, F jS Y");
$strMessageBody = "";
$strMessageBody .= "A new order has been received. A summary of this order appears below.\n";
$strMessageBody .= "\n";
$strMessageBody .= "Order Date: $today \n";
$strMessageBody .= " \n";
$strMessageBody .= "Bill To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $b_first $b_last: \n";
$strMessageBody .= " $b_addr \n";
$strMessageBody .= " $b_addr2 \n";
$strMessageBody .= " $b_city, $b_state $b_zip \n";
$strMessageBody .= " $b_phone \n";
$strMessageBody .= " $b_fax \n";
$strMessageBody .= " $b_email \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Ship To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $s_first $s_last \n";
$strMessageBody .= " $s_addr \n";
$strMessageBody .= " $s_addr2 \n";
$strMessageBody .= " $s_city, $s_state $s_zip \n";
$strMessageBody .= " $s_phone \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Qty Price(\$) Product ID - Product Name\n";
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n";
if( $NAME_2 ) {$strMessageBody .= "$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";}
if( $NAME_3 ) {$strMessageBody .= "$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";}
if( $NAME_4 ) {$strMessageBody .= "$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";}
if( $NAME_5 ) {$strMessageBody .= "$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";}
if( $NAME_6 ) {$strMessageBody .= "$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";}
if( $NAME_7 ) {$strMessageBody .= "$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";}
if( $NAME_8 ) {$strMessageBody .= "$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";}
if( $NAME_9 ) {$strMessageBody .= "$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";}
if( $NAME_10 ){$strMessageBody .= "$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";}
if( $NAME_11 ){$strMessageBody .= "$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";}
if( $NAME_12 ){$strMessageBody .= "$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";}
if( $NAME_13 ){$strMessageBody .= "$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";}
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "SUBTOTAL: $SUBTOTAL \n";
$strMessageBody .= "TOTAL: $TOTAL \n";
$strMessageBody .= "\n";
$strMessageBody .= "FREIGHT: $SHIPPING \n";
$strMessageBody .= "\n\n";
$strMessageBody .= "Comments: \n";
$strMessageBody .= "--------- \n";
$strMessageBody .= "$comment \n";
$strMessageBody .= " \n";
if( $mode == "BOTH" || $mode == "EMAIL") {
//# Send email order to you...
$mailheaders = "From: $b_email\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "New Online Order";
mail($youremail, $subject, $strMessageBody, $mailheaders);
}
if( $mode == "BOTH" || $mode == "FILE") {
$csvcomments = $comment;
if (!$CSVF = fopen($csvfilename,'a')) {
doError("Unable to open CSV file for writing. Your order has not been saved.");
exit;
}
fputs($CSVF, $string);
fputs($CSVF, "\"");
fputs($CSVF, "$today");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_first");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_last");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_addr");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_addr2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_city");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_state");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_zip");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_phone");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_fax");
fputs($CSVF, "\",\"");
fputs($CSVF, "$b_email");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_first");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_last");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_addr");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_addr2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_city");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_state");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_zip");
fputs($CSVF, "\",\"");
fputs($CSVF, "$s_phone");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_1");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_2");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_3");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_4");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_5");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_6");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_7");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_8");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_9");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_10");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_11");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_12");
fputs($CSVF, "\",\"");
fputs($CSVF, "$QUANTITY_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "\$$PRICE_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ID_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$NAME_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$ADDTLINFO_13");
fputs($CSVF, "\",\"");
fputs($CSVF, "$SUBTOTAL");
fputs($CSVF, "\",\"");
fputs($CSVF, "$TOTAL");
fputs($CSVF, "\",\"");
fputs($CSVF, "$SHIPPING");
fputs($CSVF, "\",\"");
fputs($CSVF, "$comment");
fputs($CSVF, "\"\n");
fclose($CSVF);
}
//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);
include($header);
echo "<h2>Thank you</h2>";
echo "Thank you for your order from our online store. You will receive a confirmation email of your order ";
echo "momentarily. Please contact us at $youremail if you have any questions or concerns.";
echo "<P>";
echo "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
echo "<P>";
include($footer);
?>
Deze is nog in het engels, moet dit nog omzetten naar het nederlands, maar wil het eerst
werkend hebben voordat ik de rest ga aanpassen
Het mail bericht komt wel aan maar zonder data, zie onderstaande bericht:
A new order has been received. A summary of this order appears below.
Order Date: Wednesday, June 5th 2013
Bill To:
--------
:
,
Ship To:
--------
,
Qty Price($) Product ID - Product Name
=====================================================================
$ -
=====================================================================
SUBTOTAL:
TOTAL:
FREIGHT:
Comments:
---------
Als ik in het bestelformulier (header.html) na het invullen van de naw gegevens op de knop verzenden heb gedrukt dan komt ik uit op checkout2.php, daar staat dan de inhoud van het winkelwagentje en het formulier voor de naw gegevens en in de adresbalk van google staat de naam van de webshop en de ingevulde naw gegevens.
http://www.hetmadeliefjekinderkleding.nl/checkout2.php?Q=1&b_first=bogaart&b_last=b&b_addr=Broedershof&b_addr2=Broedershof&b_city=veghel&b_zip=5462EG&b_phone=041329133&b_email=bogaartpoil@gmail.com
Het is een lange uitleg met een klein probleem denk ik, maar ik zie het niet, wie wil/kan mij helpen.
Edit:
Code tussen codetags geplaatst ([code] en [/code]). Gelieve dit in het vervolg te doen. Zo blijft het forum goed leesbaar. Ook raad ik aan om geen maialdressen in code plaatsen in het forum, mail-harvesters liggen altijd op de loer om de spam te verhogen....
Gewijzigd op 06/06/2013 13:14:49 door - Ariën -
op de zevende regel wordt in javascript de functie ManageCart(); aangeroepen.
waarschijnlijk moet deze functie wat html uitspugen maar dat gebeurd niet.
ik weet niet welke browser je gebruikt maar in chrome kun je op f12 klikken om fouten te bekijken.
Ik gebruik internet Explorer 9, daar werkt F12 ook, ga kijken of ik daar iets kan vinden
Kijk eens naar OpenCart of FreeWebShop
Heb je het opgelost ik kom er ook niet uit
Gezien dit punt en de rest van de coding style: hoe oud is dit script? Het lijkt wel alsof het van voor PHP 4.1 oid stamt dus voor de "superglobals" als $_GET en $_POST.
(en dat is volgens mij ruim 10 jaar)
Het werkt met cookies, het aantal producten per bestelling is beperkt, en de producten in het assortiment zijn hardcoded (als ik het me goed herinner). Daarnaast is het opslaan van order gegevens in een bestand niet echt aan te bevelen.
Kijk eens naar OpenCart of FreeWebShop, dat zijn redelijk licht gewicht php webshops.