Do you want to put up a simple store-front, but don't have CGI access to do it? Then this free JavaScript shopping-cart is exactly what you need. This software only needs JavaScript, which every browser supports these days. You won't have to become a database-administrator! Your products can be on many separate pages. This complete, simple, easy-to-use shopping-cart makes it easy to implement any e-commerce site. All that's required is pasting-in the supplied source-code on each page that customers can purchase products from, and revising the supplied shoppingcart.htm file to identify the payment-processor you've chosen.
Who uses this shopping-cart? Some of the sites using it are:
Some of the options that are configurable:
Other Options: See the Javascript file nopercart.js for a complete list, and description, of all options. Near the top of the file you'll see comments describing all the options, and after that you'll see assignment statements giving values to them. Most options are either true/false, a string, or a number; for true/false options, you enter either true or false, replacing the existing value; for string options, enter any text you wish between the quote-marks -- this can include HTML tags; for numeric options, simply enter the number you wish. However, the ShipTable and PackTable options are arrays of structures that are made up of strings and numbers; the examples in nopercart.js will show you how to specify these options.
When editing the options, be aware that punctuation matters in Javascript statements; however, everything after a "//" is a comment, where anything goes.
The 2nd line is optional, only needed to make nopERcart use a language other than English. The language-pack choices are:
noper-language-cs_CZ_cp1250.js | Czech (by Jan Egert)
| noper-language-da_DK.js | Danish (by Glenn Jensen)
| noper-language-de.js | German (by bjarnat_r@hotmail.com)
| noper-language-de_alt.js | German (alternate by Mike)
| noper-language-el_GR_utf8.js | Greek-Modern (by bill@vpournaras.gr) -- new in nopERcart 2007-08-05
| noper-language-eo.js | Esperanto (by Ernie Knolfson of zengarten.com) -- new in nopERcart 2007-08-05
| noper-language-es.js | Spanish (by Capitán Nemo Comunicaciones)
| noper-language-et_utf8.js | Estonian (by pilv) -- new in nopERcart 2007-08-05
| noper-language-fi.js | Finnish (by Mikko Lähteenmäki aka ifreq)
| noper-language-fr.js | French (by Fred of noe.master.online.fr and Jean-Pierre David j-pdavid@videotron.ca)
| noper-language-he_IL_iso8859-8.js | Hebrew (by Mr. Eliezer Tavor / MOR / Web-Master)
| noper-language-hu_iso8859-2.js | Hungarian (by Robert Horvath)
| noper-language-it.js | Italian (by Colomela Francesco)
| noper-language-ms_MY.js | Malay (by bennyong of hostonfire.com)
| noper-language-nl.js | Dutch (by Ron A.J. Hartendorp of Computer Network Services, pra@xidis.com, and Corina van Weert of catchy-eyes.nl)
| noper-language-no.js | Norwegian (by Thomas A. Amundsen of graphic.no)
| noper-language-pdt.js | Plautdietsch (by me, Eugene Reimer) -- new in nopERcart 2007-08-05
| noper-language-pl_utf8.js | Polish (by Archmag)
| noper-language-pt_BR.js | Portuguese-Brazil (by Jane Araújo)
| noper-language-pt_PT_utf8.js | Portuguese-Portugal (by Phosphoros) -- new in nopERcart 2007-08-05
| noper-language-ro.js | Romanian (by Florin B)
| noper-language-ru_cp1251.js | Russian (by Vladimir of lukianov.ru) -- new in nopERcart 2007-08-05
| noper-language-sl_SI_utf8.js | Slovenian (by Berto art-reef.com) -- new in nopERcart 2007-08-05
| noper-language-sk_cp1250.js | Slovak (by Jaro Nemcok)
| noper-language-sv_SE.js | Swedish (by Artur Stensson)
| noper-language-sv_SE_alt.js | Swedish (improved alternate by Béatrice: bea@ludd.luth.se or www.ludd.luth.se/~bea)
| noper-language-tr_utf8.js | Turkish (by Yetkin Degirmenci of yetkindegirmenci.com) -- new in nopERcart 2007-08-05
| noper-language-zh_TW_big5.js | Chinese-Traditional (by C.J. Ho of SunnyFactory)
| |
<FORM action="shoppingcart.htm" onSubmit="return AddToCart(this)"> <input type=hidden _ID="Sample-001" _NAME="My Sample Product" _PRICE="19.95" _WEIGHT="30" _LENGTH="25" _WIDTH="16" _HEIGHT="10"> Quantity: <input type=text name="_QUANTITY" value="1" size=2 maxlength=3 onChange="this.value=CKquantity(this.value)"> <input type=SUBMIT value="Add to Cart"> </FORM>Of course you will replace the right-side of _ID, _NAME, _PRICE, _WEIGHT, _LENGTH, _WIDTH, _HEIGHT with information for your product. If shipping-size doesn't affect your shipping-costs, simply omit the _LENGTH, _WIDTH, _HEIGHT attributes. On the other hand, if size alone determines your shipping-costs then omit the _WEIGHT attribute.
For Quantity-Discount pricing, the _PRICE can be a comma-separated list of terms, such as:
| 3.95 | -- means 3.95 each; |
| 3.95,2:3.00 | -- means 3.95 for the first, 2nd and subsequent are 3.00 each; |
| 3.95,10=2.99 | -- means 3.95 each, or exactly 10 for 29.90; |
| 3.95,10=2.99,10:2.99 | -- means 3.95 each, 10 or more are 2.99 each; |
| 3.95,2:3.00,4:2.75,8:2.50 | -- means 2nd...are 3.00, 4th...are 2.75, 8th and subsequent are 2.50; |
| 3.95,2:-30,GRP01 | -- means 2nd and subsequent are 30% off, and this applies across all products in the group GRP01; |
For promotional Discount-Coupons, the _PRICE can be something like:
| >=40:-15.00 | -- means if the pre-tax pre-shipping subtotal is at least 40.00 this 15.00 discount applies; |
| >=0:-10.00 | -- means this 10.00 discount applies without any qualification; |
| >=0:-25% | -- means this 25% discount applies without any qualification; |
If you have USERCHOICE's for your customers (eg: for Colour, Style, etc), then your form will look something like:
<FORM action="shoppingcart.htm" onSubmit="return AddToCart(this)">
<input type=hidden _ID="Sample-001" _NAME="My Sample Product" _PRICE="19.95" _WEIGHT="30" _LENGTH="25" _WIDTH="16" _HEIGHT="10">
Size:
<select name=USERCHOICE>
<option _ID="+S" _NAME="+ Small"> Small
<option _ID="+M" _NAME="+ Medium"> Medium
<option _ID="+L" _NAME="+ Large"> Large
</select>
Colour:
<select name=USERCHOICE2>
<option _ID="+R" _NAME="+ Red"> Red
<option _ID="+W" _NAME="+ White"> White
<option _ID="+B" _NAME="+ Blue"> Blue
</select>
Quantity:
<input type=text name="_QUANTITY" value="1" size=2 maxlength=3 onChange="this.value=CKquantity(this.value)">
<input type=SUBMIT value="Add to Cart">
</FORM>
Other sorts of USERCHOICE selectors are illustrated in the supplied shopping.htm example. A product can have up to ten such USERCHOICEn choices, for n being emptystring or 1..9; each can be either a select-statement or a set of radio-buttons; each can supply values for any of _ID, _NAME, _PRICE, _WEIGHT, _LENGTH, _WIDTH, _HEIGHT; the value for _ID or _NAME can be either a replacement or a string-to-be-added; for a numeric attribute, either a replacement or a number-to-be-added; in both cases a leading plus-sign indicates to-be-added.
The above code snippets will take your customer directly to the View-Cart page upon clicking Add-to-Cart.
If you wish to avoid that: remove the ACTION part of the FORM tag; consider enabling the DisplayPopupOnAdd option;
consider adding the following to the above snippet so that customers see a summary of their cart-contents, and can get to your View-Cart page when they wish to:
PayPal (PaymentProcessor="pp"):
<FORM action="https://www.paypal.com/cgi-bin/webscr" method=POST onSubmit="return ValidateCart(this)">
<SCRIPT> ManageCart(); </SCRIPT>
<input type=hidden name="currency_code" value="USD">
<input type=hidden name="return" value="http://YOUR-DOMAIN-NAME/shoppingthanks.htm">
<input type=hidden name="business" value="YOUR-EMAIL">
<input type=SUBMIT value="Check-Out">
</FORM>
You will replace "USD" with the currency-code for your currency; eg: "CAD".
You will replace "http://YOUR-DOMAIN-NAME/shoppingthanks.htm" with the URL of your own Thanks-for-your-Purchase page.
You will replace "YOUR-EMAIL" with the email-address that identifies your Merchant-Account at PayPal.
Google-Checkout (PaymentProcessor="gc"):
<FORM action="https://checkout.google.com/cws/v2/Merchant/YOUR-MERCHANT-ID/checkoutForm" method=POST onSubmit="return ValidateCart(this)">
<SCRIPT> ManageCart(); </SCRIPT>
<input type=IMAGE src="http://checkout.google.com/buttons/checkout.gif?merchant_id=YOUR-MERCHANT-ID&w=180&h=46&style=white&variant=text&loc=en_US>
</FORM>
You will replace BOTH occurrences of YOUR-MERCHANT-ID with your own Merchant-ID at Google.
LinkPoint (PaymentProcessor="lp"):
<FORM action="https://secure.linkpt.net/lpcentral/servlet/lppay" method=POST onSubmit="return ValidateCart(this)">
<SCRIPT> ManageCart(); </SCRIPT>
<input type=hidden name="storename" value="YOUR-STORE-ID">
<input type=SUBMIT value="Check-Out">
</FORM>
WorldPay (PaymentProcessor="wp"):
<FORM action="https://select.worldpay.com/wcc/purchase" method=POST onSubmit="return ValidateCart(this)">
<SCRIPT> ManageCart(); </SCRIPT>
<input type=hidden name="instId" value="YOUR-WORLDPAY-ID">
<input type=hidden name="currency" value="USD">
<input type=hidden name="testMode" value="0">
<input type=hidden name="cartId" value="WebPurchase">
<input type=SUBMIT value="Check-Out">
</FORM>
Authorize.net (PaymentProcessor="an"):
<FORM action="https://secure.authorize.net/gateway/transact.dll" method=POST onSubmit="return ValidateCart(this)">
<SCRIPT> ManageCart(); </SCRIPT>
<input type=hidden name="x_Login" value="YOUR-ID">
<input type=SUBMIT value="Check-Out">
</FORM>
CGI Checkout (PaymentProcessor="cgi"):
If you're equipped with a secure server, then you can go this route.
For example, if your secure server is www.secure.com, your checkout-script is shoppingcheckout.pl, and it accepts POST mode, then your FORM tag would be:
HTML Checkout (PaymentProcessor=""):
If you want the two-step approach, then your FORM tag will be:
For questions about the nopERcart shopping-cart, just ask ereimer@shaw.ca .
To hire someone with experience in using nopERcart, try: fredmace@bellsouth.net ; catchy-eyes .
I'd like to hear from you if you're using this cart, even if you're not having problems. I'll be happy to mention your site as one using it.
Eugene 2007-July