forked from jstnryan/jCart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.php
121 lines (92 loc) · 3.55 KB
/
store.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
<?php
// INCLUDE JCART BEFORE SESSION START
include 'jcart/jcart.php';
// START SESSION
session_start();
// INITIALIZE JCART AFTER SESSION START
$cart =& $_SESSION['jcart']; if(!is_object($cart)) $cart = new jcart();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>jCart - Free Ajax/PHP shopping cart</title>
<style type="text/css">
* { margin:0; padding:0; }
html { background:#fff; font-family:trebuchet ms, candara, sans-serif; font-size:62.5%; }
body { font-size:1.5em; }
#wrapper { margin:30px auto 250px auto; width:890px; border:solid 1px #ccc; padding:30px; background:#efefef; }
h2 { margin-bottom:1em; }
#sidebar { width:35%; float:right; }
#content { width:60%; }
.jcart { margin:0 20px 20px 0; padding-top:20px; border:dashed 2px #66cc66; float:left; background:#fff; text-align:center; }
.jcart ul { margin:0; list-style:none; padding:0 20px; text-align:left; }
.jcart fieldset { border:0; }
.jcart strong { color:#000066; }
.jcart .button { margin:20px; padding:5px; }
fieldset { border:0; }
#paypal-button { display:block; padding:10px; margin:20px auto; }
.clear { clear:both; }
</style>
<link rel="stylesheet" type="text/css" media="screen, projection" href="jcart/jcart.css" />
</head>
<body>
<div id="wrapper">
<h2>Demo Store</h2>
<div id="sidebar">
<?php $cart->display_cart($jcart);?>
</div>
<div id="content">
<form method="post" action="" class="jcart">
<fieldset>
<input type="hidden" name="my-item-id" value="1" />
<input type="hidden" name="my-item-name" value="Soccer Ball" />
<input type="hidden" name="my-item-price" value="25.00" />
<ul>
<li><strong>Soccer Ball</strong></li>
<li>Price: $25.00</li>
<li>
<label>Qty: <input type="text" name="my-item-qty" value="1" size="3" /></label>
</li>
</ul>
<input type="submit" name="my-add-button" value="add to cart" class="button" />
</fieldset>
</form>
<form method="post" action="" class="jcart">
<fieldset>
<input type="hidden" name="my-item-id" value="2" />
<input type="hidden" name="my-item-name" value="Baseball Mitt" />
<input type="hidden" name="my-item-price" value="19.50" />
<ul>
<li><strong>Baseball Mitt</strong></li>
<li>Price: $19.50</li>
<li>
<label>Qty: <input type="text" name="my-item-qty" value="1" size="3" /></label>
</li>
</ul>
<input type="submit" name="my-add-button" value="add to cart" class="button" />
</fieldset>
</form>
<form method="post" action="" class="jcart">
<fieldset>
<input type="hidden" name="my-item-id" value="3" />
<input type="hidden" name="my-item-name" value="Hockey Stick" />
<input type="hidden" name="my-item-price" value="33.25" />
<ul>
<li><strong>Hockey Stick</strong></li>
<li>Price: $33.25</li>
<li>
<label>Qty: <input type="text" name="my-item-qty" value="1" size="3" /></label>
</li>
</ul>
<input type="submit" name="my-add-button" value="add to cart" class="button" />
</fieldset>
</form>
<div class="clear"></div>
</div>
</div>
<script type="text/javascript" src="jcart/jquery-1.12.2.min.js"></script>
<script type="text/javascript" src="jcart/jcart-javascript.min.php"></script>
</body>
</html>