forked from wojodesign/simplecart-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
144 lines (88 loc) · 5.11 KB
/
README
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
***************************************************************************************
* simpleCart(js)
* -----------------------------------------------------------------------------------
* Version 2.0
* The Wojo Group
* thewojogroup.com
* simplecartjs.com
* http://github.com/thewojogroup/simplecart-js/tree/master
* Released under MIT License
***************************************************************************************
No databases, no programming, no headaches. A simple javascript shopping
cart in under 17kb that you can setup in minutes. It's lightweight, fast,
simple to use, and completely customizable. All you need to know is basic HTML.
***************************************************************************************
Copyright (c) 2009 The Wojo Group
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
***************************************************************************************
* QUICK START GUIDE
***************************************************************************************
After downloading the files, simply place a copy of the simpleCart.js
in your site directory, and attach it to each page that will be using the cart:
1.<script type="text/javascript" src="simpleCart.js"></script>
PayPal is the default checkout option. So if you have a Paypal account, you
will need to set your account email:
1.<script type="text/javascript">
2. simpleCart.email = "[email protected]";
3.</script>
----------------
Items for Sale
----------------
To have an item for sale (like an awesome t-shirt), you can put it on your
"Shelf" like so:
1.<div class="simpleCart_shelfItem">
2. <h2 class="item_name">Awesome T-Shirt</h2>
3. <span class="item_price">$35.95</span>
4. <input class="item_quantity" value="1" type="text">
5. <a href="javascript:;" class="item_add">Add to Cart</a>
6.</div>
To create a shelf item, you create a div with a class of “simpleCart_shelfItem”.
Any field you want for your item can be set by creating a tag with a class
of “item_field-name” and the contents or value of the tag will be the value
added for the item. Please check out Shelf Setup for more info about the shelf.
You can also add an item to the cart with a simple link:
1.<a href="javascript:;" onclick="simpleCart.add( 'name=Awesome t-shirt' ,
'price=35.95' , 'quantity=1' );">Add To Cart</a>
---------------------------
Cart Links and Cart Summary
---------------------------
If you want to display information about the cart anywhere on your page, simple
create any tag (div, span, a, h2, …etc) with a specific class name.
For the total items in the cart, use “simpleCart_quantity”
1.You have <span class="simpleCart_quantity"></span> items in your Cart.
For the cart total, use “simpleCart_total”
1.Cart total: <div class="simpleCart_total"></div>
You can create a Checkout link or Empty Cart link by using "simpleCart_checkout"
and "simpleCart_empty"
1.<a href="javascript:;" class="simpleCart_checkout">Checkout</a>
2.<a href="javascript:;" class="simpleCart_empty">Empty</a>
The checkout link will immediately send all the items to PayPal (or another
checkout option like Google Checkout) when you click it. These don't have to be
links, however, you can also use a div, images, or any other tag by simply
setting the class correctly.
--------
The Cart
--------
You can display the full cart on any page by simply creating a div with a class
of "simpleCart_items"
1.<div class="simpleCart_items"></div>
SimpleCart(js) will automatically populate the div with all the items in the
cart. You can change the appearance of your cart or what columns are in the cart
by checking out Cart Header Formatting.
***************************************************************************************
* For more information, please go to simplecartjs.com
***************************************************************************************