simpleCart(js) Version 2.0 Released!
We are happy to announce the release of simpleCart(js) version 2.0 today. We have been working hard to add several features that you all have requested, and we’re excited to get this script in your hands. There are several new features, including GoogleCheckout, easy currency settings, tax, shipping, and a new method for adding items to your cart that requires no javascript, and allows for different inputs and options. There is also a brand new site to go along with this update: simplecartjs.com . Please take a minute to check out all the new features, documentation, and demo. Thanks to all those who have been helping test for the past few weeks, we couldn’t have released this new version without your help.
Upgrading your version
If you are already using simpleCart(js), the only thing you need to change to use the new script is how you add it to your page:
<script src="simpleCart.js" type="text/javascript"></script> <script type="text/javascript"> simpleCart.email = "you@yours.com"; </script>
Check out the website, simplecartjs.com to learn about the new features, and let us know what you think!
Tags: ecommerce, google checkout, javascript shopping cart, simple cart, simpleCart, simpleCart(js), version 2
Posted in Programming, simpleCart(js) 76 Comments »



Delicious
StumbleUpon
Facebook
Reddit
Nice one, thanks for the update. Quick question for you though – although I’ve got a feeling this will be on the wish-list. Does this support subscriptions through Paypal? Or is there a fairly simple hack that can be done to allow them?
Keep up the good work.
Thanks again.
I don’t want to rain on your parade, but if I open up Firebug, or Safari’s Web Inspector. I only have to do a simple simpleCart.items.c7.price = 0.01 and go to checkout for a really cheap DVD.
Other than that, very impressive work.
Hey Jim, yeah there have been lots of discussions about the security and how/when to use a cart like this. In general, it was made for low volume carts where an individual could easily check the orders for foul play. For larger ecommerce systems, simpleCart(js) simply provides a front end, and I would always suggest running a check on the server side before allowing someone to checkout.
-
We have implemented both types using the script, and haven’t had any problems. The biggest issue is knowing what kind of cart you need, and using simpleCart(js) accordingly. Thanks for the input!
Made a template/layout for download. Have a look here:
http://wfiedler-online.de/index.php?p=templates
Congratulations and thanks for hard work, Brett… but… I really can not make it work for e-mail orders. I hope you could make an version for e-mails only, without Paypal or Google Checkout… Cheers…
when I want to buy send me a mail with the order without going to paypal as possible
Great script but im having a small problem…
When using Google Checkout I have added 4 items to the cart and click check out it only displays 1 on the google page (and only 1 items cost).
When i try this again using my paypal it displays all 4 items plus the flat rate shipping.
I didnt know where to report this. if you would like to see the demo script just say
Nice work Brett!
I will definitely try it very soon.
Cheers!
Thanks for the great little script!
I have found a bug(?) I thought you may want to know about. When I’m running another script that’s using prototype.js in some capacity, it disables SimpleCart.
I’ve noticed that if you have more than 6 entries in the cart, my local server will give a 400 Bad Error because the cookie that simpleCart is trying to pass it on is too large. Is there a solution to this issue?
Nice work
but there’s not enough security
we can chage the amount to pay even from the link to PayPal
If you could make it more secure, it will be the best e-commerce script
nice work anyway
I found a bug in the Google Checkout implementation.. The counter variable isn’t auto incrementing therefore Google takes the first item so you can only have one product in the Google’s actual checkout cart.
Add counter++; to the end of the for loop in the GoogleCheckout function!
@Jordan Stout – thanks for that ive been wondering about a solution since i posted the problem on the 19th… works great now
A bug and a suggestion:
1. An apparent bug: I need to gather 2 options per product. I added 2 different selects, item_size and item_pitch. Both show up properly on the page, but when I go to checkout, the line that says “Options:” only shows the first of the two. If I swap the order of the 2 selects, it still shows the first one in the list.
2. Please add a field for the total shipping cost. You have the total, and the tax. Why not shipping too?
3. I saw this on the planned list, but here’s my vote for it: please allow me to change the item price based on what the customer chooses in a select. Some things cost more when they get bigger!
Overall, this is a great little cart. Very easy to use and configure once you get the basic idea.
Testing simpleCart.js and I have to say I am quite pleased with it’s functionality. However, I have a situation where I need to run checkout after validating some other form fields… in essence I am asking: Is there is a way to execute checkout from a JavaScript command?
Hello,
I’m amazed of this script, but i can’t launch on my website. I did everything like in instructions, but in web it is showing like plain text. Take a look: http://www.smagu.vhost.lt
What i am doing wrong?
Thanks for the answers
Please please please make it work with prototype.js
Hi! I am using the script and work ok, but when i use mootools the script stop to working. I found the bug, is that mootools add other properties to the elements. I used in the code the same fixings.
1) var myRegExp = /[0-9]+/g
where the for is called
for( header in this.cartHeaders ){
I added…
if(header.test(myRegExp)){…}
And in the function Shelf.prototype.checkChildren = function ( item , newItem) {
I added
if(item.childNodes){…
I trying to make it working, but i can´t do 100% yet. I will repost the final code when i finish.
Regards Enrique
Hi!
I did a version working with mootools, maybe it work with prototype too.
If someone need it just ask me here for this.
Regards, Enrique
Great job Brett!!!
But it´s hard to integrate into Joomla because of some troubles with Mootools.
Thinking on solve this in further versions?
Hi there Enrique!
It would be very nice if you could share your script! (enfant_terr1ble@botmail.com)
Thanks
I would like the version that works with mootools. Can you send it to me?
Thanks so much
Sorry, here is my email: hampton1122@gmail.com
Hey mate, i’ve been trying to get this to work too, is there any chance you can send me the mootools working verison to a_r_marriott@hotmail.com
thanks for your time bud i apprecaite your effort in makigna working version,
Hello Enrique, can you send me your mootools files please? I need to integrate simpleCart to a Yootheme template and zoo…
Thanks
Hi!
I did a version working with mootools, maybe it work with prototype too.
If someone need it just ask me here for this.
Regards, Enrique
Hello Enrique,
I would like the version of simpleCart that works with mootools.
My version is Mootools 1.2
Can you send it to me please?
My E-mail : bigjim21 [at] freesurf.fr
Thank you very much
Sorry for my english … i’m french !
A mootools friendly version would be great! bdelcamp(at)gmail(dot)com. Thanks!
Hello Enrique, can you send me your mootools files please? I need to integrate simpleCart to a Yootheme template and zoo…
my email is codigo3net@gmail.com
Thanks
Brett,…defenitely a thing I will test.
I saw a Joomla integration of this…. I think, over at Rockettheme.
Another question – has nothing to do with this:
What Script do you use for that nice “Share” Button?
I would really appreciate if you would tell me
The share button is built with about 10 lines of javascript. Just a simple toggle button. The various share links inside it are all provided by the various sites they link to and the “tweet this” button is from tweetmeme
Great job Brett!!!.
But it´s hard to integrate into Joomla because of some troubles with Mootools.
Thinking on solve this in further versions?
I’m trying to figure out how to make sure options such as size and color show up when the item is placed in the shopping cart… and to make sure it gets forwarded on to the paypal cart. Can anyone help?
This is what I found on the paypal site but I can’t figure out how to tweak the .js to display it…
on0
Optional
First option field name and label. The os0 variable contains the corresponding value for this option field. For example, if on0 is size, os0 could be large.
*
Optional for Buy Now, Subscribe, and Add to Cart buttons
*
Not used with Donate or Buy Gift Certificate buttons
64
on1
Optional
Second option field name and label. The os1 variable contains the corresponding value for this option field. For example, if on1 is color then os1 could be blue.
You can specify a maximum of 7option field names (6 with Subscribe buttons) by incrementing the option name index (on0 through on6).
*
Optional for Buy Now, Subscribe, and Add to Cart buttons
*
Not used with Donate or Buy Gift Certificate buttons
64
os0
Optional
Option selection of the buyer for the first option field, on0. If the option field is a dropdown menu or a set of radio buttons, each allowable value should be no more than 64 characters. If buyers enter this value in a text field, there is a 200-character limit.
Note:
The option field on0 must also be defined. For example, it could be size.
For priced options, include the price and currency symbol in the text of the option selections, as the following sample code shows:
small – $10.00
Add a corresponding option_select0 and option_amount0 variable for each priced option. Priced options are supported only for Buy Now and Add to Cart buttons. Only one dropdown menu option selection can have priced options.
*
Optional for Buy Now, Subscribe, and Add to Cart buttons
*
Not used with Donate or Buy Gift Certificate buttons
64 or 200
See description.
os1
Optional
Option selection of the buyer for the second option field, on1. If the option field is a dropdown menu or a set of radio buttons, each allowable value should be no more than 64 characters. If buyers enter this value in a text field, there is a 200-character limit.
You can specify a maximum of 7 option selections (6 with Subscribe buttons) by incrementing the option selection index (os0 through os6). You can implement up to 5 option selections as dropdown menus and up to 2 option selections as test boxes.
Note:
A corresponding option field (on0 through on6) must defined.
*
Optional for Buy Now, Subscribe, and Add to Cart buttons
*
Not used with Donate or Buy Gift Certificate buttons
64 or 200
See description.
option_index
See description.
The cardinal number of the option field, on0 through on9, that has product options with different prices for each option. You must include option_index if the option field with prices is not on0.
*
Optional for Buy Now and Add to Cart buttons
*
Not used with Donate, Subscribe, or Buy Gift Certificate buttons
Default – 0
option_select0
Optional
For priced options, the value of the first option selection of the on0 dropdown menu. The values must match exactly, as the next sample code shows:
small – $10.00 …
*
Optional for Buy Now and Add to Cart buttons
*
Not used with Donate, Subscribe, or Buy Gift Certificate buttons
64
option_amount0
Optional
For priced options, the amount that you want to charge for the first option selection of the on0 dropdown menu. Use only numeric values; the currency is taken from the currency_code variable. For example:
small – $10.00… <input type="hidden" name="option_amount0" value=”10.00″>
*
Optional for Buy Now and Add to Cart buttons
*
Not used with Donate, Subscribe, or Buy Gift Certificate buttons
64
option_select1
Optional
For priced options, the value of the second option selection of the on0 dropdown menu. For example:
… small – $10.00…
You can specify a maximum of ten option selections by incrementing the option selection index (option_select0 through option_select9).
Note:
A corresponding option selection in os0 must also be set.
*
Optional for Buy Now and Add to Cart buttons
*
Not used with Donate, Subscribe, or Buy Gift Certificate buttons
https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
Thanks for this wonderful script!
I’m having some problems with the code.
What happens is whenever I add something to the cart, it reflects the quantity correctly. However if I navigate to another webpage on my site, this thing returns as empty again. Only upon clicking another item to add to cart again, then the quantity will appear again, and it will still be correct.
Anyone else have this problem?
Edwin, can you provide a link the site you’re having the problem with?
It could be a cookie issue. Do you have cookies turned off? Try going to demo.simplecartjs.com and add a few of the items to the cart. Then click “view demo in new window” near the top and see if those items are still in the cart. If they are not, its an issue with your browser not accepting cookies.
First of all thanks for the effort.
My website is in Spanish, my question is:
How could change the headers, for example “Price”, “Quantity”, … to my language in the code? What should change? Please help me, I’ve been playing long code but I can not see the articles.
The cart I think it’s fantastic.
Thank you very much and sorry for my English.
Gonzalo.
Gonzalo,
I am working on some code to allow for different languages for headers and variables. I will keep you updated. You can also check out the github repo (dev branch) to follow the updates:
http://github.com/thewojogroup/simplecart-js/tree/dev
Is there a way to “check out” by email? Instead of someone paying through paypal or google it would send me an email with the details of their order so that I could contact my clients and use my own merchant?
That would be awesome!
Someone clicks “Send Order” and a modal dialog box shows up asking for basic Name, Email, Address and then sends the details to me. Any thoughts?
Hi Danny,
I am looking for the same thing. Do you have any solutions for this?
Cheer.
Thanks for the AMAZING script! This could save me hours and hours and … you get the idea.
I’m right there with everyone else though about prototype.js? Is there a fix for that anyone knows about? I’d love to get this going!
Cheers
= Sherman
Hey Sherman,
I added in some code that should help out the compatibility issues with prototype and jquery. Right now the fixes have been added to the script in the ‘dev’ brand on github:
http://github.com/thewojogroup/simplecart-js/tree/dev
if you download the regular ’simplecart.js’ the updated code is at the very bottom. If someone gets a chance to test with it, please let me know if it fixes everyones problems.
Cheers
Brett, great script! But in response to your recent prototype fix, including prototype.js still breaks simpleCat(js) for me. I downloaded the Nov. 19 version off github.
For anyone looking to integrate simpleCart(js) with Joomla, RocketTheme has put together a nice little extension:
http://www.rockettheme.com/extensions-joomla/rokquickcart
Hi Brett thanks for a wonderful script.
Is there a way to redirect customers to a different page after they have checked out of paypal?
Matt
nice script! but how do you make the cart update if you add an item from an iframe? the item is on another page and cart is still on index. if you manually update the page it works, but is there a way to autoupdate it as soon as its added?
A possible fix would be to use a small script with a timer to check for changes to the cart, and update the page accordingly.
Thanx Brett! Too bad my scriptskills are at kindergarden level
Is there any way to add a discount feature?
For example, entering a code takes off a specified dollar or percentage value, then recalculates the total? Eg entering 9112 gives you $10.00 or 10% discount etc.
Thanks
How can I get this to work with a site that has mootools too?
Hi
Ian just wondering how can i change Simple cart (js) to send all the info & new fields like email & name to my email address instead of paypal because i don’t use it for a shopping cart i will be using it as a short list
Thank You
Hi,
Can anyone tel me how to add a product description page such that if I click on the product in the homepage, it has to lead to the description page. My programming skills are not very good, with a little help, I can do it…Can anyone help me out with this…??
Hi !
I love your simpleCart.
But is it possible to add features for donwloadable products ?
I really would pay for this !
Regards
Ralf
Thanks for a great tool. I look forward to it’s growth.
I’d like to add to the requests:
* CHECKOUT TO OWN PAGE, LIKE CHECKOUT.PHP
I use my own gateway and just need simplecart to pass the current cart contents to my script.
Thanks for your hard work!
Hi there, this is for the creator of simplecart


I have an issue!
GREAT help – it’s sorted all my problems in setting up my site, really wonderful… my only issue is that i can’t for the life of me figure out how to format the finished cart?? All the items are adding up perfectly, everything is working and in-sync, but the cart just looks like a left-aligned set of lines, with no table formatting or anything – it’s very difficult to work out for someone reading it. I need to find out how to format it into columns, but i’m finding this real hard since there is no actual ‘text’ per se in my script which i can format! It all just appears automatically. Is there a simple table code i can put somewhere, which will format it into the right columns for me?
Any help would be so appreciated!
xx
Does ANYONE know how to format the cart??
( Please help!
I just have a bunch of lines… instead of the item falling under the header ‘Item’, the price falling under the header ‘price’, the quantity under the header ‘quantity’ etc, i just have:
Item
Price
Quantity
Clear skin pack (the item)
$18.99 (the price)
1
+
_
Empty
Checkout
How do i get this into columns that make sense?? Any help would be greatly appreciated.
That was exactly what I was looking for. I’ll be integrating that straight into my site as soon as our manufacturers send the items over.
I had dreaded to use PHP, when I found 0-uses for it. I didn’t need any storage of customer information. I just need customers to buy the things, and keep promotional material as decorations and not spam.
This is great… thanks guys!!!!
Hello! Great work Brett!
Is there any way to make it work with a email address?
Collect the shopping cart info to another page, complete the name and address fileds and send them to a email.
10x!
Anyone know how to format the shopping cart page into it’s appropriate column/table form? Please?
Seems like I must find out myself how to do the email stuff.
Still have another 2 questions ( I’m new with JS):
1. When I use the Email function that collect’s the items and click the submit button it send’s me to my email address (gmail for example). There all the products will appear verry messy in my message form.
How can I format the data like this ( name, description, price)without =3A%#$!@$ stuff to appear in the message form ?
2. Let’s say I have new and used products on a website.
The new products cand be added normal.
Each used product is unique and can be added to the cart only once time and then stop. How can I do that?
i also need to know this info let me know if you found a solution!
I love simplecart.
I’ve desinged a e-commerce site with all my needs. http://www.duermesano.es
Thanks.
Love the script but I have noticed that if you have more than one product page, sometimes, if you click on an item on page one then navigate to page two and click on a different item, it replaces the first item in the cart, leaving the cart with only the second item and not the two items selected?
Anyone else seen this or have a solution?
Great script, but this doesn’t work with Mootools.
You can test by adding this in your document HEAD:
Simplecartjs will stop working.
I was glad to find this script and hope to use it for a client, but it might depend on the ability to upload product info from another site or database. The wiki page for “Loading the Shelf From External Sources” is currently empty (http://wiki.github.com/thewojogroup/simplecart-js/loading-the-shelf-from-external-sources). Can anyone tell me if/how this feature is possible?
To give wordpress-users the possibillity to extend their wordpress-themes with your script, i started the site http://specialwp.com.
You could download selected themes with integrated simpleCart(JS) (more to come) , suggest your needed theme to integrate or could download a developer kit to integrate the script by yourself.
Only downside is that the checkout is restricted to Paypal and Google Checkout. I would like to have an email checkout option.
I found a workaround for a specific issue I was having.
By default simpleCart js auto assigns the “item number” that gets sent to PayPal, but this conflicted with my site that sells digital goods and sends the buyer the correct file based on the “item number.” (Item #1 would mean nothing to my IPN script that delivers the files.)
In the simpleCart.js file, on line 208 I added && field != “my_number”, then on 215 I replaced “counter” with “item.my_number”.
And lastly, I modify my add to cart link to include ‘my_number=1234′, or whatever your item number is.
Hope this helps anyone with a similar issue.
Great script !
And to make it work with prototype.js I found a solution here : http://www.huddletogether.com/forum/comments.php?DiscussionID=3940
Sorry, my fix doesn’t work really good. The products added to the cart are disabled…
Hey Brett,
Owesome work. Can you, or somebody from subscribers, tell me how to send all data from the cart to my email instead paypal or google check out?
Sorry for my english, I’m from Macedonia
Thanks
Hey i am lovig this script – but unfortunately i cant get the currency to switch to
DKK = Danish Kroner ?
is dkk not supported in the script or what am i doing wrong here ?
did you use another short for Danish Kroner than DKK ?? (the one that paypal uses)
really hope you can help!
Hello,
I modified the script to display just 10 items, and from the last inserted to the first. This part was easy. However, I want something like when I increment with add to cart button, the last item updated moves to the first row. Is there a way to achieve that easily?
Thanks
First of all, great script! Thank you for sharing
I am just having one slight problem with it.
- I navigate to my website.
- Add products to the cart.
- Total price and quantity are updated.
- Go to view cart page.
- The total price and quantity are now set to 0.
However…
If I repeat the process for a second time, the items will remain in the cart and NOT reset when I go to the view cart page?
Any ideas? Thanks!
Has anyone managed to integrate a discount/promo code function?
What I’m trying to achieve is have a input box that the user can enter a code and all items have a 20% discount applied.
Any ideas?
Thanks
Hey,
simpleCart(js) is a wonderful shopping cart, but for my shop i don’t need paypal or google checkout. I need only an email checkout, is there any possibility to implement this?
is anyone having problem adding the product that is more than 6?
Even i add just 7 product onto the shelf, the script won’t work (cannot checkout or empty cart)
Does anyone having the same problem?